[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[14366] branches/SM-1_4-STABLE/squirrelmail/ functions/forms.php
From:       pdontthink () users ! sourceforge ! net
Date:       2013-06-15 1:49:03
Message-ID: E1Unfc2-0004EY-S0 () sfs-ml-3 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 14366
          http://sourceforge.net/p/squirrelmail/code/14366
Author:   pdontthink
Date:     2013-06-15 01:49:02 +0000 (Sat, 15 Jun 2013)
Log Message:
-----------
Add id attributes to form inputs

Modified Paths:
--------------
    branches/SM-1_4-STABLE/squirrelmail/functions/forms.php

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/forms.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/forms.php	2013-06-14 23:04:58 UTC \
                (rev 14365)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/forms.php	2013-06-15 01:49:02 UTC \
(rev 14366) @@ -23,7 +23,8 @@
  */
 function addInputField($type, $name = null, $value = null, $attributes = '') {
     return '<input type="'.$type.'"'.
-        ($name  !== null ? ' name="'.sm_encode_html_special_chars($name).'"'   : \
''). +        ($name !== null ? ' name="'.sm_encode_html_special_chars($name).'"' : \
''). +        ($name !== null && strpos($attributes, 'id="') === FALSE ? ' \
                id="'.sm_encode_html_special_chars(strtr($name, '[]', '__')).'"' : \
                '').
         ($value !== null ? ' value="'.sm_encode_html_special_chars($value).'"' : \
'').  ' ' . $attributes . " />\n";
 }
@@ -92,7 +93,9 @@
             sm_encode_html_special_chars($v) . "\n";
     }
 
-    $ret = '<select name="'.sm_encode_html_special_chars($name) . "\">\n";
+    $ret = '<select name="'.sm_encode_html_special_chars($name)
+         . ($name !== null ? '" id="'.sm_encode_html_special_chars(strtr($name, \
'[]', '__')).'"' : '"') +         . ">\n";
     foreach ($values as $k => $v) {
         if(!$usekeys) $k = $v;
         $ret .= '<option value="' .
@@ -124,6 +127,7 @@
  */
 function addTextArea($name, $text = '', $cols = 40, $rows = 10, $attr = '') {
     return '<textarea name="'.sm_encode_html_special_chars($name).'" '.
+        ($name !== null && strpos($attr, 'id="') === FALSE ? \
'id="'.sm_encode_html_special_chars(strtr($name, '[]', '__')).'" ' : ' ').  \
'rows="'.(int)$rows .'" cols="'.(int)$cols.'" '.  $attr . \
'>'.sm_encode_html_special_chars($text) ."</textarea>\n";  }

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


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic