[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. 325660347ae709b50b15c7161bdd8ccd672a2cc3

Stefan Hornburg racke at rt.icdevgroup.org
Thu Feb 19 09:40:08 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  325660347ae709b50b15c7161bdd8ccd672a2cc3 (commit)
      from  bbf3b253664f0a68565f3f3c22f34a3537557da3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 325660347ae709b50b15c7161bdd8ccd672a2cc3
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Feb 19 10:37:55 2009 +0100

    accept general attributes for a form element name

-----------------------------------------------------------------------

Summary of changes and diff:
 README        |   22 ++++++++++++++++++++++
 code/form.tag |    2 +-
 2 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/README b/README
index 7f5860f..4a6439c 100644
--- a/README
+++ b/README
@@ -60,6 +60,28 @@ templates/form
 Alternative templates can be specified in table form_series, field
 template.
 
+Attributes
+----------
+
+Every form element can have a set of attributes, stored in the form_attributes
+table. They are working pretty much the same as in the metadata table for the
+Interchange UI.
+
+Attributes can be applied for every form element with a certain name:
+
+wellwell=> select * from form_attributes where name = 'country';
+ code |  name   | component |  attribute   |                           value                            
+------+---------+-----------+--------------+------------------------------------------------------------
+   32 | country |           | lookup_query | SELECT code,name FROM country ORDER BY priority DESC, name
+
+Or only for a certain from:
+
+wellwell=> select * from form_attributes where component = 'content_edit';
+ code | name |  component   | attribute | value 
+------+------+--------------+-----------+-------
+   30 | uri  | content_edit | width     | 200
+   31 | body | content_edit | height    | 400
+
 Plugins
 *******
 
diff --git a/code/form.tag b/code/form.tag
index 99eb1bc..4b9d75c 100644
--- a/code/form.tag
+++ b/code/form.tag
@@ -152,7 +152,7 @@ sub {
 			# fetch attributes for form element
 			my (%attributes, $required);
 		
-			$attrset = $Db{form_attributes}->query(q{select attribute,value from form_attributes where name = '%s' and component = '%s'}, $elref->{name}, $opt->{part});
+			$attrset = $Db{form_attributes}->query(q{select attribute,value from form_attributes where name = '%s' and (component = '' or component = '%s') order by component asc}, $elref->{name}, $opt->{part});
 			for (@$attrset) {
 				$attributes{$_->[0]} = $_->[1];
 			}


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list