gforge-commits
[Top][All Lists]
Advanced

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

[Gforge-commits] gforge/www/include html.php,1.35,1.36


From: tperdue
Subject: [Gforge-commits] gforge/www/include html.php,1.35,1.36
Date: Wed, 06 Oct 2004 11:27:20 -0500

Update of /cvsroot/gforge/gforge/www/include
In directory db.perdue.net:/home/tperdue/share/dev.gforge.org/www/include

Modified Files:
        html.php 
Log Message:
Pugliese patch for cloning fields in tracker

Index: html.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/include/html.php,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- html.php    5 Oct 2004 18:30:18 -0000       1.35
+++ html.php    6 Oct 2004 16:27:12 -0000       1.36
@@ -324,7 +324,7 @@
  * html_build_multiple_select_box() - Takes a result set, with the first 
column being the "id" or value
  * and the second column being the text you want displayed.
  *
- * @param              int             The result set
+ * @param              int     The result set
  * @param              string  Text to be displayed
  * @param              string  The item that should be checked
  * @param              int             The size of this box
@@ -350,7 +350,6 @@
        }
 
        $rows=db_numrows($result);
-
        for ($i=0; $i<$rows; $i++) {
                if ((db_result($result,$i,0) != '100') || 
(db_result($result,$i,0) == '100' && !$show_100)) {
                        $return .= '
@@ -373,6 +372,58 @@
 }
 
 /**
+ * html_build_multiple_select_box_from_arrays() - Takes a result set, with the 
first column being the "id" or value
+ * and the second column being the text you want displayed.
+ *
+ * @param              array   id of the field  
+ * @param              array   Text to be displayed
+ * @param              string  id of the items selected
+ * @param              string  The item that should be checked
+ * @param              int             The size of this box
+ * @param              bool    Whether or not to show the '100 row'
+ */
+function 
html_build_multiple_select_box_from_arrays($result,$name,$fieldid,$field,$select,$checked_array,$size='8',$show_100=true)
 {
+       global $Language;
+       $checked_count=count($checked_array);
+       $return .='
+               <select name="'.$select.'" multiple="multiple" 
size="'.$size.'">';
+       if ($show_100) {
+               /*
+                       Put in the default NONE box
+               */
+               $return .= '
+               <option value="100"';
+               for ($j=0; $j<$checked_count; $j++) {
+                       if ($checked_array[$j] == '100') {
+                               $return .= ' selected="selected"';
+                       }
+               }
+               $return .= 
'>'.$Language->getText('include_html','none').'</option>';
+       }
+
+       $rows=count($result);
+       for ($i=0; $i<$rows; $i++) {
+               if (( $result[$i] != '100') || ($result[$i] == '100' && 
!$show_100)) {
+                       $return .=' 
+                               <option value="'.$fieldid[$i].'"';
+                       /*
+                               Determine if it's checked
+                       */
+                       $val=$result[$i];
+                       for ($j=0; $j<$checked_count; $j++) {
+                               if ($val == $checked_array[$j]) {
+                                       $return .= ' selected="selected"';
+                               }
+                       }
+                       $return .= '>'.$result[$i].'-'. $name[$i].': '. 
$fieldid[$i].'-'.$field[$i].' </option>';
+               }
+       }
+       $return .= '
+               </select>';
+       return $return;
+}
+
+/**
  *     html_build_checkbox() - Render checkbox control
  *
  *     @param name - name of control





reply via email to

[Prev in Thread] Current Thread [Next in Thread]