Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2012-01-05 14:03:36

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: [howto] How to add more Form types

uli wrote:

Strikes me that the field shouldn’t show up on the default form page.

Maybe this code will solve the issue? Just download the code, backup your existing include/txp_form.php and overwrite it with this one.


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#14 2012-01-05 14:34:47

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: [howto] How to add more Form types

LastMod patch – add new field LastMod in txp_form table.
Some code was taken from a file include/txp_article.php
This patch should not cause conflicts with other modules or plug-ins.

Install:
1. In phpMyAdmin add new field LastMod in txp_form table with type datetime

or run sql

ALTER TABLE `txp_form` ADD `LastMod` datetime NOT NULL default '0000-00-00 00:00:00'

or run inside TxP

safe_alter("txp_form", "add `LastMod` datetime NOT NULL default '0000-00-00 00:00:00' ");

2. Download LastMod patch , backup your existing include/txp_form.php and overwrite it with this one.

Last edited by makss (2012-01-05 15:24:27)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#15 2012-01-05 15:09:45

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

Re: [howto] How to add more Form types

makss wrote:

Maybe this code will solve the issue?

That’s Stef’s file, as far as I can tell.

makss wrote:

or run safe_alter("txp_form", "add `LastMod` datetime NOT NULL default '0000-00-00 00:00:00' ");

Gives back an SQL error (#1064)


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

Offline

#16 2012-01-05 15:29:39

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: [howto] How to add more Form types

uli wrote:

That’s Stef’s file, as far as I can tell.

Yes, this is Stef’s code with my little patch.

Gives back an SQL error (#1064)

I corrected the previous post and posted there pure sql

Last edited by makss (2012-01-05 15:32:17)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#17 2012-01-05 15:42:17

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

Re: [howto] How to add more Form types

makss wrote:

Yes, this is Stef’s code with my little patch.

No, sorry, I did a diff: identical files.


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

Offline

#18 2012-01-05 15:43:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: [howto] How to add more Form types

uli wrote:

Strikes me that the field shouldn’t show up on the default form page.

Why not? Just because you can’t rename the form doesn’t mean you can’t put it in another category. Even in the current (non-patched) screen I can reassign my default form to the ‘Links’ category if I so desired.

Please explain why you think people should not be able to move it to an arbitrary area of their choosing? (e.g. they could collect all non-deletable forms into one group called “Static”). Might be something I’ve overlooked.

Last edited by Bloke (2012-01-05 15:44:50)


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

Offline

#19 2012-01-05 15:53:52

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

Re: [howto] How to add more Form types

Bloke wrote:

Even in the current (non-patched) screen I can reassign my default form to the ‘Links’ category if I so desired.

Thats true, I missed that. But I find it irritating, nevertheless. And in working environments with several people cooperating it might be confusing to not find the default form, counter-intuitively, on its traditional place. Just my 0.02 €.


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

Offline

#20 2012-01-05 16:06:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: [howto] How to add more Form types

uli wrote:

it might be confusing to not find the default form, counter-intuitively, on its traditional place.

So you’re proposing that this patch goes the extra step of removing the select list and text box (or making them static like makss did in his patch-of-my-patch) when anyone is editing a non-deletable form, thus forbidding anyone from moving it to a new category? Seems a bit drastic, but if your view represents the majority then who am I to argue!

Last edited by Bloke (2012-01-05 16:12:43)


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

Offline

#21 2012-01-09 13:48:51

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

Re: [howto] How to add more Form types

Bloke wrote:

[…] thus forbidding anyone from moving it to a new category? Seems a bit drastic […]

Hm, the wording is a bit drastic. Would we judge it as a forbiddance if we could avoid the misplacing of our keyrings? (And I was speaking of only the default form, BTW, not any non-deletable.)


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

Offline

#22 2012-03-01 12:42:47

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

Re: [howto] How to add more Form types

Bloke wrote:

…anyone wanna try this altered Form panel out where …

I have try and it work fine!
Very good idea and great solution.

It must be included into core code. Maybe the 4.4.2 release? With maybe some other improvement!

Offline

#23 2012-03-01 14:36:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: [howto] How to add more Form types

MarcoK wrote:

I have try and it work fine!

Thanks for trying it out: glad it worked ok. I like it too. Unfortunately Robert didn’t like it so it probably won’t make core. Although it’s perhaps possible to control it using a pref like this:

Permit unlimited form types: o No   o Yes   o Yes, defaults protected

With ‘No’ being default behaviour. The final option would satisfy Uli’s request at being unable to move default (undeletable) Form types from their pre-assigned locations. Not sure if this kind of thing would be of benefit or if it makes it too complicated from a support perspective.


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

Offline

#24 2013-03-08 22:26:15

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

Re: [howto] How to add more Form types

Bloke wrote:

Permit unlimited form types: o No o Yes o Yes, defaults protected
With ‘No’ being default behaviour. The final option would satisfy Uli’s request at being unable to move default (undeletable) Form types from their pre-assigned locations. Not sure if this kind of thing would be of benefit or if it makes it too complicated from a support perspective.

This is a great idea.

I ask again… include in new version???

Offline

Board footer

Powered by FluxBB