Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-19 19:38:25

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

rah_tabtor // Copy+paste backend's navigation tabs

Rah_tabtor allows to move navigation links (sub-tabs) from one tab to another. Let’s say that you had a plugin that had an interface under Extensions, but you would like it to show under Content. With rah_tabtor that is possible.

More info and downloads

Examples, you say. Let me see. What if we turn rah_sitemap to our test experiment? We don’t want to hurt rabbits, so rah_sitemap will suffice. As you can see (the shot below), rah_sitemap resides in Extensions (tip: click the images for full-view).

Man Extensions area is crowded. Let’s click the Create new rule link thingy and copy Sitemaps over to Content. After clicking the link, we will get a view that resembles this:

We want to select Content as the group and Sitemap as the event. Label can be anything. I will use Sitemap Tools.

After hitting save, we can see that the rah_sitemap (Sitemap Tools) can now be found from Content.

Last edited by Gocom (2010-10-19 19:42:53)

Offline

#2 2010-10-19 20:47:54

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

Haven’t tried yet, but… wow!

Offline

#3 2010-10-19 21:22:12

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

Zanza wrote:

Haven’t tried yet, but… wow!

Thanks :-)

Offline

#4 2010-10-19 22:50:18

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

I wish you’d stop doing this to me Jukka. That is very clever indeed. Now I can defy plugin authors at will. ;)

How come it gets an “Order” of 9? I thought it only went up to 5???

Last edited by thebombsite (2010-10-19 22:53:18)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#5 2010-10-19 23:18:08

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

Re: rah_tabtor // Copy+paste backend's navigation tabs

Cool! I’ve been manually editing plugins to move around so they made more sense. Sounds like you’ve just made it a whole lot easier.

Thanks Jukka

Offline

#6 2010-10-20 03:34:15

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

thebombsite wrote:

I wish you’d stop doing this to me Jukka.

Never Stuart, never! I won’t go easy on you :-)

How come it gets an “Order” of 9? I thought it only went up to 5???

You mean the plugin’s load order value? Rah_tabtor want’s to be the last ;-)

maverick wrote:

Cool! I’ve been manually editing plugins to move around so they made more sense. Sounds like you’ve just made it a whole lot easier.

Thanks Mike. Only drawback is that rah_tabtor can’t hide/remove tabs, only copy. There are some ways how removing could be done but there is no feature in TXP to do so.

Offline

#7 2011-06-06 21:54:01

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

Update has been landed the local retailers. Rah_tabtor version 0.2 includes:

  • Fix: Don’t spit beans if JavaScript is disabled.
  • Added: Uninstaller sporting plugin-lifecycle callbacks. Drops plugin created preference strings and tables when plugin is deleted.
  • Added: Now admin-side interface uses language strings and is translatable using TextPacks.
  • Added: “Options” link to the Plugin pane.
  • Changed: Moved preferences from own database table to txp_prefs table. Plugin includes automated clean up script.
  • Changed: Try to run installer only if the version number doesn’t match, instead of letting MySQL to decide.
  • Changed: Markup changes to the admin-side interface; <thead> and <tbody> containers to the tables, rah_ui selector classes to common elements for easier theming.
  • Changed: Shortened the admin-side interface step names.
  • Changed: Inform the user if deleting or updating item failed because of an database error.
  • Changed: Improved JavaScript based multie-edit script.
  • Changed: Requests sent as GET are ignored when saving details.
  • Changed: Specify charset as UTF-8 when creating new database tables.
  • Changed: Expanded the admin-side pane’s permitted privileges from Publishers to Managing Editors.
  • Removed: Plugin’s own preferences pane.
  • Now requires Textpattern version 4.2.0 or newer for full feature support.

More info and downloads

Offline

#8 2011-10-21 23:25:52

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

Hi Gocom.
Thanks for another little rah gem.

Some quick comments.
Docs say:

Copy backend’s navigation links from one tab to another.

Am I wrong or rah_tabtor moves (move != copy) the navigations links from tab to tab?
I’d say that I prefer this “move” feature rather than the (incorrectly?) advertised “copy” feature.

The plugin doesn’t let you hide or remove tabs, but rah_tabtor’s solely purpose is cooking copy pasta. If you want to change permissions and hide tabs based on privilege levels, I suggest checking out redbot’s bot_privs. The two play well together.

I’d have liked the feature of hiding/removing tabs included in rah_tabtor. :)
That being said, it seems that there is some buggy behavior: I’ve tried to move the “Categories” tab from its first (#1) spot on “Content” tab to the last spot (at the very end of the line of tabs) on the same “Content” tab.
In other words, I’ve tried to use rah_tabtor to re-order the tabs on “Content”.

For that, I created a rule (Label: Categories, Event: Categories, Group: Content, Position: 9) that, as said, I’d have expected to make the tab appear at the very end of the “Content” tab.

But instead of the “Categories” tab being moved, it just disappeared.

A few other weird issues that popped while investigating this one:

Event drop-down getting transformed into a text input

  1. Create this rule: Label: Categories, Event: Categories, Group: Content, Position: 9.
  2. Save it
  3. Edit it again. At this point, the Event field may have been transformed from a select into a text input.

If the above didn’t triggered the issue, try this

  1. Create this rule: Label: Categories, Event: Categories, Group: Content, Position: 9.
  2. Save it
  3. Edit it to change Label to “Categoriesssss”
  4. Save it
  5. Edit it to change the Label back to “Categories”
  6. Save it. At this point, the Event field may have been transformed from a select into a text input.

As you can see, I couldn’t yet find a proper way to reproduce this issue. Sometimes it happens, sometimes not, sorry :(

Gocom, let me know if you need some more info or if you would like me to try something. Thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2012-08-30 04:10:57

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

Rah_tabtor v0.3 is out. Changes:

  • Fixed: Full Textpattern 4.5 compatibility. Improved look and feel.
  • Fixed: Uninstall query’s wildcard escaping.
  • Added: CSRF protection.
  • Added: Tell activity message its type (error, success, warning). Helps themes to style messages accordingly.
  • Added: Menu items created by plugins are now moved instead of copied. This doesn’t affect core tabs, which are protected and can not be modified.
  • Added: Finnish translation.
  • Added: French translation by Patrick Lefevre.
  • Improved: Installer now defines default values for the varchar fields.
  • Improved: Sort items in in the list table by their label.
  • Removed: Embedded language strings from the source code in favor of external Textpacks.
  • Removed: Documentation link from navigation.
  • Now requires Textpattern v4.5.0 or newer, and PHP 5.2 or newer.

More info and downloads

Offline

#10 2012-08-30 04:54:14

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_tabtor // Copy+paste backend's navigation tabs

Sorry for the late reply Julián, wasn’t aware of your post.

maniqui wrote:

Am I wrong or rah_tabtor moves (move != copy) the navigations links from tab to tab?
I’d say that I prefer this “move” feature rather than the (incorrectly?) advertised “copy” feature.

It actually does just copy when it comes to built-in core tabs. It isn’t able to move or hide. This is due to technical limitations set forth by Textpattern. Core panels are protected, so to speak sandboxed, and can not be modified or removed programmatically.

The plugin uses navigation item registering interface to change a navigation link’s location, and that can not touch anything the core has added. Only way to change core navigation structure is by hacks implemented through admin-side themes or by changing page’s output markup.

v0.3 address moving and copying as good as it can. There isn’t much it can do due to limitations (which should be there), but v0.3 supports moving plugin generated navigation items. Core items can still only be copied/cloned.

I’d have liked the feature of hiding/removing tabs included in rah_tabtor. :)

It’s the same deal as the above. It’s unfortunately impossible to implement in a plugin without actually modifying directly the resulting output markup. This translates to a hack which would be limited in support. It could only support selected set of themes for instance as the modified markup pattern would have to be known and is defined by the theme.

For that, I created a rule (Label: Categories, Event: Categories, Group: Content, Position: 9) that, as said, I’d have expected to make the tab appear at the very end of the “Content” tab.

The position setting only affects menu items created by rah_tabtor. Sorting amongst the plugin’s menu items. Any menu item created by the plugin will always appear after built-in items.

But instead of the “Categories” tab being moved, it just disappeared.

That’s tricky. Two same named menu items can not exists in a same menu. Textpattern’s limitation or safe guard. When you try to register second item with same label as a core menu item, this will happen. Both disappear. Only thing I can do would be preventing the editor from creating an offending rule.

As you can see, I couldn’t yet find a proper way to reproduce this issue. Sometimes it happens, sometimes not, sorry :(

The field’s behavior is set in the code, It’s actually by design. The conversion to a text field is there to offer protection. The plugin gets the list of available panels from Textpattern. Thing is, when you register new items, the menu and these items changes. The menu also can be subject to permissions and initialization order. To prevent the event from being un-editable, the field is turned to a text field when a matching event (panel) isn’t found from the list.

For instance when you created that category rule, the menu item disappeared due to the item limitation which doesn’t allow two same menu items in a same menu. As the menu item disappeared it wasn’t in the list and the field was converted to a text field so that it can still be edited.

Rah_tabtor v0.3 remedies this. v0.3 stores a initial list of events in memory when the plugin is first initialized. This offers mild protection against issues caused event collisions and duplicates. The Events field does still turn in to a text field if the specific event isn’t found from the list. This can happen if a plugin that were targeted by the rule was uninstalled, which would make the panel to be unreachable.

Hope this clears some confusion. I’ve also updated the docs to address some of these caveats.

Offline

Board footer

Powered by FluxBB