[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1967] trunk/UI/lib/elements.html



Revision: 1967
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1967&view=rev
Author:   einhverfr
Date:     2007-12-08 14:36:31 -0800 (Sat, 08 Dec 2007)

Log Message:
-----------
Adding hooks for data-structure independance for select boxes.

Modified Paths:
--------------
    trunk/UI/lib/elements.html

Modified: trunk/UI/lib/elements.html
===================================================================
--- trunk/UI/lib/elements.html	2007-12-08 09:07:43 UTC (rev 1966)
+++ trunk/UI/lib/elements.html	2007-12-08 22:36:31 UTC (rev 1967)
@@ -102,6 +102,18 @@
 <?lsmb # SELECT ELEMENT ?>
 <?lsmb BLOCK select ?>
   <?lsmb IF element_data  # Only process element if one exists. ?>
+    <?lsmb IF element_data.defined('text_attr') ?>
+        <?lsmb text_attr =  element_data.text_attr ?>
+        <?lsmb element.text_attr = undef ?>
+    <?lsmb ELSE ?>
+	<?lsmb text_attr = 'text' ?>
+    <?lsmb END ?>
+    <?lsmb IF element_data.defined('value_attr') ?>
+        <?lsmb text_attr =  element_data.value_attr ?>
+        <?lsmb element.value_attr = undef ?>
+    <?lsmb ELSE ?>
+	<?lsmb value_attr = 'value' ?>
+    <?lsmb END ?>
     <?lsmb IF element_data.defined('default_values') ?>
 	    <?lsmb  # Undef items must be removed, or they choke in the options defaults check later.
         i = 0;
@@ -138,6 +150,12 @@
 
 <?lsmb # OPTION ELEMENT ?>
 <?lsmb BLOCK option ?>
+  <?lsmb IF element_data.defined('value_attr');
+	option_data.value = option_data.$value_attr;
+    END ?>
+  <?lsmb IF element_data.defined('text_attr');
+	option_data.text = option_data.$text_attr;
+    END ?>
   <?lsmb  # Selected is a special case -- no attribute key, so it's handled here by looking for the option value in the default_values key.
     IF element_data.defined('default_values') AND element_data.default_values.grep("^${option_data.value}$").size;
     option_data.selected = ' selected="selected"';


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.