]> err.no Git - sope/commitdiff
embed labels in <label> tags
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 31 Aug 2006 00:44:33 +0000 (00:44 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 31 Aug 2006 00:44:33 +0000 (00:44 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1355 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/DynamicElements/WOCheckBoxList.m
sope-appserver/NGObjWeb/Version

index 992366b94406ecfa0733cd86b1825433a9d621b7..77426bb215f709c21546045bd6f3f45359eacb85 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-31  Wolfgang Sourdeau  <WSourdeau@Inverse.CA>
+
+       * DynamicElements/WOCheckBoxList.m: embed 'suffix' label binding in
+         a label tag enclosing the checkbox (v4.5.245)
+
 2005-08-15  Sebastian Reitenbach  <reitenbach@rapideye.de>
 
        * WOWatchDogApplicationMain.m: include <unistd.h> instead of
index 4b924d5870f94745f2b856cb1e0ff519da746d86..8f96fba283d7ef072fff1d00aaf8f59ce12f5ae2 100644 (file)
   
     /* add checkbox */
     {
-      NSString *n = nil;
+      NSString *n, *label;
   
-      n = self->name
+      label = [self->suffix stringValueInComponent:sComponent];
+      if (![label isNotEmpty]) label = nil; /* remove null/empty strings */
+      
+      n = self->name != nil
        ? [self->name stringValueInComponent:sComponent]
        : OWFormElementName(self, _ctx);
-  
+      
+      if (label != nil)
+       WOResponse_AddCString(_response, "<label>");
+      
       WOResponse_AddCString(_response, "<input type=\"checkbox\" name=\"");
       [_response appendContentHTMLAttributeValue:n];
       WOResponse_AddCString(_response, "\" value=\"");
        n = [self->value stringValueInComponent:sComponent];
        WOResponse_AddHtmlString(_response, n);
       }
-    }
-    
-    if (self->suffix != nil) {
-      NSString *ss;
 
-      ss = [self->suffix stringValueInComponent:sComponent];
-      WOResponse_AddString(_response, ss);
+      if (label != nil) {
+       WOResponse_AddString(_response, label);
+       WOResponse_AddCString(_response, "</label>");
+      }
     }
+    
     [_ctx incrementLastElementIDComponent];
   }
   [_ctx deleteLastElementIDComponent]; // list index
index 8186a38386bb3f68a26e2bae39d6f7f0099f31ef..ce37dc3a0bb6d9e548dabfd2760b26ad6945c848 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=244
+SUBMINOR_VERSION:=245
 
 # v4.5.234 requires libDOM          v4.5.21
 # v4.5.214 requires libNGExtensions v4.5.179