Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for phpMyEdit/phpMyEdit.class.php between version 1.55 and 1.56

version 1.55, 2003/03/17 19:30:44 version 1.56, 2003/03/18 00:52:59
Line 19 
Line 19 
  * http://www.platon.sk/projects/phpMyEdit/   * http://www.platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.54 2003/03/06 23:16:56 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.55 2003/03/17 19:30:44 nepto Exp $ */
   
 /*      phpMyEdit intro {{{ */  /*      phpMyEdit intro {{{ */
 /*  /*
Line 786  function phpMyEdit_form_control(theForm)
Line 786  function phpMyEdit_form_control(theForm)
                                 echo '                                  echo '
         return true;          return true;
 }'."\n\n";  }'."\n\n";
                                 echo '// --></script>' . "\n";                                  echo '// --></script>', "\n";
                                 echo '<form class="TODO-class" action="',$page_name,'" method="POST"';                                  echo '<form class="',$this->getCSSclass('form');
                                   echo '" action="',$page_name,'" method="POST"';
                                 echo ' onSubmit="return phpMyEdit_form_control(this);">',"\n";                                  echo ' onSubmit="return phpMyEdit_form_control(this);">',"\n";
                                 return true;                                  return true;
                         }                          }
                 }                  }
   
                 echo '<form class="TODO-class" action="',$page_name,'" method="POST">',"\n";                  echo '<form class="',$this->getCSSclass('form'),'" action="',$page_name,'" method="POST">',"\n";
                 return true;                  return true;
         } /* }}} */          } /* }}} */
   
Line 812  function phpMyEdit_form_control(theForm)
Line 813  function phpMyEdit_form_control(theForm)
                         if (! $this->displayed[$k]) {                          if (! $this->displayed[$k]) {
                                 continue;                                  continue;
                         }                          }
                         echo '<tr class="TODO-class">'."\n";                          echo '<tr class="',$this->getCSSclass('row', '', true),'">',"\n";
                         echo '<td class="TODO-class">'.$this->fdd[$k]['name'].'</td>'."\n";                          echo '<td class="',$this->getCSSclass('key', '', true),'">',$this->fdd[$k]['name'],'</td>',"\n";
                           echo '<td class="',$this->getCSSclass('value', '', true),'">'."\n";
                           $css_class_name = $this->getCSSclass('input', '', true);
                         if ($this->col_has_values($k) && !$this->readonly($k)) {                          if ($this->col_has_values($k) && !$this->readonly($k)) {
                                 echo '<td class="TODO-class">'."\n";  
                                 $multiple = ($this->fdd[$k]['select'] == 'M' || $this->col_is_set($k))                                  $multiple = ($this->fdd[$k]['select'] == 'M' || $this->col_is_set($k))
                                                 && ! $this->fdd[$k]['values']['table'];                                                  && ! $this->fdd[$k]['values']['table'];
                                 $vals = isset($this->fdd[$k]['values']['table'])                                  $vals = isset($this->fdd[$k]['values']['table'])
                                         ? $this->set_values_from_table($k)                                          ? $this->set_values_from_table($k)
                                         : (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values'];                                          : (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values'];
                                 echo $this->htmlSelect($this->fds[$k], $vals, '', $multiple);                                  echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, '', $multiple);
                                 echo '</td>'."\n";  
                         } elseif (isset ($this->fdd[$k]['textarea']) && !$this->readonly($k)) {                          } elseif (isset ($this->fdd[$k]['textarea']) && !$this->readonly($k)) {
                                 echo '<td class="TODO-class"><textarea class="TODO-class" ';                                  echo '<textarea class="',$css_class_name,'" ';
                                 if (isset ($this->fdd[$k]['textarea']['rows'])) {                                  if (isset ($this->fdd[$k]['textarea']['rows'])) {
                                         echo 'rows="'.$this->fdd[$k]['textarea']['rows'].'" ';                                          echo 'rows="',$this->fdd[$k]['textarea']['rows'],'" ';
                                 }                                  }
                                 if (isset ($this->fdd[$k]['textarea']['cols'])) {                                  if (isset ($this->fdd[$k]['textarea']['cols'])) {
                                         echo 'cols="'.$this->fdd[$k]['textarea']['cols'].'" ';                                          echo 'cols="',$this->fdd[$k]['textarea']['cols'],'" ';
                                 }                                  }
                                 echo 'name="'.$this->fds[$k].'" wrap="virtual">';                                  echo 'name="',$this->fds[$k],'" wrap="virtual">';
                                 echo $this->htmlDisplay(                                  echo $this->htmlDisplay(
                                                 $this->fdd[$k], $this->fdd[$k]['default'],                                                  $this->fdd[$k], $this->fdd[$k]['default'],
                                                 false, false, false);                                                  false, false, false);
                                 echo '</textarea></td>'."\n";                                  echo '</textarea>',"\n";
                         } else {                          } else {
                                 // Simple edit box required                                  // Simple edit box required
                                 echo '<td class="TODO-class">';  
                                 $size_ml_props = '';                                  $size_ml_props = '';
                                 if ($this->fdd[$k]['type'] != 'blob') {                                  if ($this->fdd[$k]['type'] != 'blob') {
                                         $maxlen = intval($this->fdd[$k]['maxlen']);                                          $maxlen = intval($this->fdd[$k]['maxlen']);
Line 849  function phpMyEdit_form_control(theForm)
Line 849  function phpMyEdit_form_control(theForm)
                                 }                                  }
                                 if ($this->col_is_string($k) || $this->col_is_number($k)) {                                  if ($this->col_is_string($k) || $this->col_is_number($k)) {
                                         // string type                                          // string type
                                         echo '<input class="TODO-class" type="text" '.($this->readonly($k)?'disabled ':'')                                          echo '<input class="',$css_class_name,'" type="text" ';
                                                 .' name="'.$this->fds[$k].'"'.$size_ml_props.' value="'                                          echo ($this->readonly($k) ? 'disabled ' : ''),' name="',$this->fds[$k],'"';
                                                 .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],                                          echo $size_ml_props,' value="';
                                                                 false, false, false)                                          echo $this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],false,false,false),'">';
                                                 .'">';  
                                 } elseif ($this->col_is_date($k)) {                                  } elseif ($this->col_is_date($k)) {
                                         // date type, get date components                                          // date type, get date components
                                         //if ($this->fdd[$k]['default'])                                          //if ($this->fdd[$k]['default'])
Line 861  function phpMyEdit_form_control(theForm)
Line 860  function phpMyEdit_form_control(theForm)
                                         //$value = time();                                          //$value = time();
                                         //echo $this->mdate_disperse($k,$value,true);                                          //echo $this->mdate_disperse($k,$value,true);
                                         // string type                                          // string type
                                         echo '<input class="TODO-class" type="text" '.($this->readonly($k)?'disabled ':'')                                          echo '<input class="',$css_class_name,'" type="text" ';
                                                 .' name="'.$this->fds[$k].'"'.$size_ml_props.' value="'                                          echo ($this->readonly($k) ? 'disabled ' : ''),' name="',$this->fds[$k],'"';
                                                 .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],                                          echo $size_ml_props,' value="';
                                                                 false, false, false)                                          echo $this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],false,false,false),'">';
                                                 .'">';  
                                 } else {                                  } else {
                                         // unknown type                                          // unknown type
                                         echo '<input class="TODO-class" type="text" '.($this->readonly($k)?'disabled ':'')                                          echo '<input class="',$css_class_name,'" type="text" ';
                                                 .' name="'.$this->fds[$k].'" value="'                                          echo ($this->readonly($k) ? 'disabled ' : ''),' name="',$this->fds[$k],'"';
                                                 .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],                                          echo $size_ml_props,' value="';
                                                                 false, false, false)                                          echo $this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],false,false,false),'">';
                                                 .'">';  
                                 }                                  }
                                 echo '</td>';  
                         }                          }
                           echo '</td>',"\n";
                         if ($this->guidance) {                          if ($this->guidance) {
                                 if ($this->fdd[$k]['help'])                                  $css_class_name = $this->getCSSclass('help', '', true);
                                         echo '<td class="TODO-class">'.$this->fdd[$k]['help'].'</td>'."\n";                                  $cell_value     = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : '&nbsp;';
                                 else                                  echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n";
                                         echo '<td class="TODO-class">&nbsp;</td>'."\n";  
                         }                          }
                         echo '</tr>'."\n";                          echo '</tr>',"\n";
                 }                  }
         } /* }}} */          } /* }}} */
   
Line 914  function phpMyEdit_form_control(theForm)
Line 910  function phpMyEdit_form_control(theForm)
                                 if (! $this->displayed[$k]) {                                  if (! $this->displayed[$k]) {
                                         continue;                                          continue;
                                 }                                  }
                                 echo '<tr class="TODO-class">';                                  echo '<tr class="',$this->getCSSclass('row', '', true),'">'."\n";
                                 echo '<td class="TODO-class">'.$this->fdd[$k]['name'].'</td>'."\n";                                  echo '<td class="',$this->getCSSclass('key', '', true),'">',$this->fdd[$k]['name'],'</td>',"\n";
                                 /* There are two possibilities of readonly fields handling:                                  /* There are two possibilities of readonly fields handling:
                                                 1. Display plain text                                     1. Display plain text
                                                 2. Display disabled input field                                     2. Display disabled input field
                                    In all cases particular readonly field will NOT be saved. */                                     In all cases particular readonly field will NOT be saved. */
                                 if (0 && $this->readonly($k)) {                                  if (0 && $this->readonly($k)) {
                                         echo $this->display_delete_field($row, $k);                                          echo $this->display_delete_field($row, $k);
Line 928  function phpMyEdit_form_control(theForm)
Line 924  function phpMyEdit_form_control(theForm)
                                         echo $this->display_change_field($row, $k);                                          echo $this->display_change_field($row, $k);
                                 }                                  }
                                 if ($this->guidance) {                                  if ($this->guidance) {
                                         if ($this->fdd[$k]['help']) {                                          $css_class_name = $this->getCSSclass('help', '', true);
                                                 echo '<td class="TODO-class">'.$this->fdd[$k]['help'].'</td>'."\n";                                          $cell_value     = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : '&nbsp;';
                                         } else {                                          echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n";
                                                 echo '<td class="TODO-class">&nbsp;</td>'."\n";  
                                         }  
                                 }                                  }
                                 echo '</tr>'."\n";                                  echo '</tr>'."\n";
                         } elseif ($this->delete_operation() || $this->view_operation()) {                          } elseif ($this->delete_operation() || $this->view_operation()) {
                                 if (! $this->displayed[$k]) {                                  if (! $this->displayed[$k]) {
                                         continue;                                          continue;
                                 }                                  }
                                 echo '<tr class="TODO-class">'."\n";                                  echo '<tr class="',$this->getCSSclass('row', '', true),'">'."\n";
                                 echo '<td class="TODO-class">'.$this->fdd[$k]['name'].'</td>'."\n";                                  echo '<td class="',$this->getCSSclass('key', '', true),'">',$this->fdd[$k]['name'].'</td>'."\n";
                                 if ($this->password($k)) {                                  if ($this->password($k)) {
                                         echo '<td class="TODO-class">'.$this->labels['hidden'].'</td>';                                          echo '<td class="',$this->getCSSclass('value', '', true),'">';
                                           echo $this->labels['hidden'],'</td>';
                                 } else {                                  } else {
                                         $this->display_delete_field($row, $k);                                          $this->display_delete_field($row, $k);
                                 }                                  }
                                 if ($this->guidance) {                                  if ($this->guidance) {
                                         if ($this->fdd[$k]['help'])                                          $css_class_name = $this->getCSSclass('help', '', true);
                                                 echo '<td class="TODO-class">'.$this->fdd[$k]['help'].'</td>'."\n";                                          $cell_value     = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : '&nbsp;';
                                         else                                          echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n";
                                                 echo '<td class="TODO-class">&nbsp;</td>'."\n";  
                                 }                                  }
                                 echo '</tr>'."\n";                                  echo '</tr>',"\n";
                         }                          }
                 }                  }
         } /* }}} */          } /* }}} */
   
         function display_change_field($row, $k) /* {{{ */          function display_change_field($row, $k) /* {{{ */
         {          {
                 echo '<td class="TODO-class">'."\n";                  echo '<td class="',$this->getCSSclass('value', '', true),'">',"\n";
                   $css_class_name = $this->getCSSclass('input', '', true);
                 if ($this->col_has_values($k) && !$this->readonly($k)) {                  if ($this->col_has_values($k) && !$this->readonly($k)) {
                         $multiple = ($this->fdd[$k]['select'] == 'M' || $this->col_is_set($k))                          $multiple = ($this->fdd[$k]['select'] == 'M' || $this->col_is_set($k))
                                         && ! $this->fdd[$k]['values']['table'];                                          && ! $this->fdd[$k]['values']['table'];
                         $vals = isset($this->fdd[$k]['values']['table'])                          $vals = isset($this->fdd[$k]['values']['table'])
                                 ? $this->set_values_from_table($k)                                  ? $this->set_values_from_table($k)
                                 : (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values'];                                  : (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values'];
                         echo $this->htmlSelect($this->fds[$k], $vals, $row["qf$k"], $multiple);                          echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, $row["qf$k"], $multiple);
                 } elseif (isset($this->fdd[$k]['textarea']) && !$this->readonly($k)) {                  } elseif (isset($this->fdd[$k]['textarea']) && !$this->readonly($k)) {
                         echo '<textarea class="TODO-class" name="'.$this->fds[$k].'"';                          echo '<textarea class="',$css_class_name,'" name="'.$this->fds[$k].'"';
                         // rows attr                          // rows attr
                         if (isset($this->fdd[$k]['textarea']['rows'])) {                          if (isset($this->fdd[$k]['textarea']['rows'])) {
                                 echo ' rows="'.$this->fdd[$k]['textarea']['rows'].'"';                                  echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"';
                         }                          }
                         // cols attr                          // cols attr
                         if (isset($this->fdd[$k]['textarea']['cols'])) {                          if (isset($this->fdd[$k]['textarea']['cols'])) {
                                 echo ' cols="'.$this->fdd[$k]['textarea']['cols'].'"';                                  echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"';
                         }                          }
                         // wrap attr                          // wrap attr
                         if (isset($this->fdd[$k]['textarea']['wrap'])) {                          if (isset($this->fdd[$k]['textarea']['wrap'])) {
                                 echo ' wrap="'.$this->fdd[$k]['textarea']['wrap'].'"';                                  echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"';
                         } else {                          } else {
                                 echo ' wrap="virtual"';                                  echo ' wrap="virtual"';
                         }                          }
                         echo '>';                          echo '>',$this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false);
                         echo $this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false);                          echo $row[$this->fds[$k]],'</textarea>',"\n";
                         echo $row[$this->fds[$k]];  
                         echo '</textarea>'."\n";  
                 } else {                  } else {
                         $size_ml_props = '';                          $size_ml_props = '';
                         if ($this->fdd[$k]['type'] != 'blob') {                          if ($this->fdd[$k]['type'] != 'blob') {
Line 998  function phpMyEdit_form_control(theForm)
Line 991  function phpMyEdit_form_control(theForm)
                         }                          }
                         if ($this->col_is_string($k) || $this->col_is_number($k)) {                          if ($this->col_is_string($k) || $this->col_is_number($k)) {
                                 // string type                                  // string type
                                 echo '<input class="TODO-class" type="text" '.($this->readonly($k)?'disabled ':'')                                  echo '<input class="',$css_class_name,'" type="text" ';
                                         .'name="'.$this->fds[$k].'" value="'                                  echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="';
                                         .$this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false)                                  echo $this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false);
                                         .'" '.$size_ml_props.'>';                                  echo '" ',$size_ml_props,'>';
                         } elseif ($this->col_is_date($k)) {                          } elseif ($this->col_is_date($k)) {
                                 echo '<input class="TODO-class" type="text" '.($this->readonly($k)?'disabled ':'')                                  echo '<input class="',$css_class_name,'" type="text" ';
                                         .'name="'.$this->fds[$k].'" value="'                                  echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="';
                                         .$this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false)                                  echo $this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false);
                                         .'" '.$size_ml_props.'>';                                  echo '" ',$size_ml_props,'>';
                         } else {                          } else {
                                 // unknown type                                  // unknown type
                                 echo '<input class="TODO-class" type="text" '.($this->readonly($k)?'disabled ':'')                                  echo '<input class="',$css_class_name,'" type="text" ';
                                         .'name="'.$this->fds[$k].'" value="'                                  echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="';
                                         .$this->htmlDisplay($this->fdd[$k],$row["qf$k"], false, true, false).'">';                                  echo $this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false);
                                   echo '" ',$size_ml_props,'>';
                         }                          }
                         echo "\n";                          echo "\n";
                 } // if elseif else                  }
                 echo '</td>'."\n";                  echo '</td>',"\n";
         } /* }}} */          } /* }}} */
   
         function display_password_field($row, $k) /* {{{ */          function display_password_field($row, $k) /* {{{ */
         {          {
                 echo '<td class="TODO-class">'."\n";                  echo '<td class="',$this->getCSSclass('value', '', true),'">',"\n";
                 $size_ml_props = '';                  $size_ml_props = '';
                 if ($this->fdd[$k]['type'] != 'blob') {                  if ($this->fdd[$k]['type'] != 'blob') {
                         $maxlen = intval($this->fdd[$k]['maxlen']);                          $maxlen = intval($this->fdd[$k]['maxlen']);
Line 1029  function phpMyEdit_form_control(theForm)
Line 1023  function phpMyEdit_form_control(theForm)
                         $size   && $size_ml_props .= ' size="'.$size.'"';                          $size   && $size_ml_props .= ' size="'.$size.'"';
                         $maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"';                          $maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"';
                 }                  }
                 echo '<input class="TODO-class" type="password" '.($this->readonly($k)?'disabled ':'')                  echo '<input class="',$this->getCSSclass('value', '', true),'" type="password" ';
                         .'name="'.$this->fds[$k].'" value="'                  echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="';
                         .$this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false)                  echo $this->htmlDisplay($this->fdd[$k], $row["qf$k"], false, true, false);
                         .'" '.$size_ml_props.'>';                  echo '" ',$size_ml_props,'>';
                 echo '</td>'."\n";                  echo '</td>',"\n";
         } /* }}} */          } /* }}} */
   
         function display_delete_field($row, $k) /* {{{ */          function display_delete_field($row, $k) /* {{{ */
         {          {
                 echo '<td class="TODO-class">';                  echo '<td class="',$this->getCSSclass('value', '', true),'">';
                 if ($this->is_values2($k, $row["qf$k"])) {                  if ($this->is_values2($k, $row["qf$k"])) {
                         echo nl2br($this->htmlDisplay($k, $this->fdd[$k]['values2'][$row['qf'.$k.'_idx']],                          echo nl2br($this->htmlDisplay($k, $this->fdd[$k]['values2'][$row['qf'.$k.'_idx']],
                                                 true, true, true, false));                                                  true, true, true, false));
                 } else {                  } else {
                         echo nl2br($this->htmlDisplay($this->fdd[$k], $row["qf$k"]));                          echo nl2br($this->htmlDisplay($this->fdd[$k], $row["qf$k"]));
                 }                  }
                 echo '</td>'."\n";                  echo '</td>',"\n";
         } /* }}} */          } /* }}} */
   
         /**          /**
          * Returns CSS class name           * Returns CSS class name
          */           */
         function getCSSclass($name, $pagetype = '', $position  = '', $dividor = '', $postfix = '') /* {{{ */          function getCSSclass($name, $position  = '', $dividor = '', $postfix = '') /* {{{ */
         {          {
                 static $div_idx = 0;                  static $div_idx = 0;
                 $elements = array($this->css['prefix'], $name);                  $elements = array($this->css['prefix'], $name);
                   if ($this->page_type && $this->css['page_type']) {
                           $elements[] = $this->page_type;
                   }
                   if ($position && $this->css['position']) {
                           $elements[] = $position;
                   }
                 if ($dividor && $this->css['dividor']) {                  if ($dividor && $this->css['dividor']) {
                         $elements[] = $div_idx;                          $elements[] = $div_idx;
                         $div_idx++;                          $div_idx++;
Line 1062  function phpMyEdit_form_control(theForm)
Line 1062  function phpMyEdit_form_control(theForm)
                                 $div_idx = 0;                                  $div_idx = 0;
                         }                          }
                 }                  }
                   if ($postfix) {
                           $elements[] = $postfix;
                   }
                 return join($this->css['separator'], $elements);                  return join($this->css['separator'], $elements);
         } /* }}} */          } /* }}} */
   
Line 1069  function phpMyEdit_form_control(theForm)
Line 1072  function phpMyEdit_form_control(theForm)
         /**          /**
          * Print CSS class name           * Print CSS class name
          */           */
         function printCSSclass($name, $pagetype = '', $position  = '', $dividor = '', $postfix = '') /* {{{ */          function printCSSclass($name, $position  = '', $dividor = '', $postfix = '') /* {{{ */
         {          {
                 echo $this->getCSSclass($name, $pagetype, $position, $dividor, $postfix);                  echo $this->getCSSclass($name, $position, $dividor, $postfix);
         } /* }}} */          } /* }}} */
   
         /**          /**
Line 1096  function phpMyEdit_form_control(theForm)
Line 1099  function phpMyEdit_form_control(theForm)
          * @param       multiple        bool for mulptiple selection           * @param       multiple        bool for mulptiple selection
          * @param       nat_sort        bool for natural sorting           * @param       nat_sort        bool for natural sorting
          */           */
         function htmlSelect($name, $kv_array, $selected = null, $multiple = false, $nat_sort = false) /* {{{ */          function htmlSelect($name, $class, $kv_array, $selected = null, $multiple = false, $nat_sort = false) /* {{{ */
         {          {
                 $ret = '<select class="TODO-class" name="'.htmlspecialchars($name);                  $ret = '<select class="'.htmlspecialchars($class).'" name="'.htmlspecialchars($name);
                 if ($multiple) {                  if ($multiple) {
                         $ret  .= '[]" multiple size="'.$this->multiple;                          $ret  .= '[]" multiple size="'.$this->multiple;
                         !is_array($selected) && $selected = explode(',', $selected);                          !is_array($selected) && $selected = explode(',', $selected);
Line 1415  function phpMyEdit_form_control(theForm)
Line 1418  function phpMyEdit_form_control(theForm)
         /*          /*
          * Display buttons at top and bottom of page           * Display buttons at top and bottom of page
          */           */
         function display_list_table_buttons($total_recs) /* {{{ */          function display_list_table_buttons($total_recs, $position) /* {{{ */
         {          {
                 $listall = $this->inc <= 0; // Are we doing a listall?                  $listall = $this->inc <= 0; // Are we doing a listall?
                 echo '<table class="TODO-class">';                  echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n";
                 echo '<tr class="TODO-class"><td class="TODO-class">' . "\n";                  echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n";
                   echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n";
                 // Note that <input disabled isn't valid HTML, but most browsers support it                  // Note that <input disabled isn't valid HTML, but most browsers support it
                 $disabled = ($this->fm > 0 && ! $listall) ? '' : ' disabled';                  $disabled = ($this->fm > 0 && ! $listall) ? '' : ' disabled';
                 echo '<input'.$disabled.' class="TODO-class" type="submit" name="'.ltrim($disabled).'prev" value="'                  echo '<input',$disabled,' class="',$this->getCSSclass('prev', $position);
                         .$this->labels['Prev'].'">&nbsp;';                  echo '" type="submit" name="',ltrim($disabled),'prev" value="',$this->labels['Prev'],'">&nbsp;';
                 if ($this->add_enabled ()) {                  if ($this->add_enabled()) {
                         echo '<input class="TODO-class" type="submit" name="operation" value="'.$this->labels['Add'].'">&nbsp;';                          echo '<input class="',$this->getCSSclass('prev', $position);
                           echo '" type="submit" name="operation" value="',$this->labels['Add'],'">&nbsp;';
                 }                  }
   
                 if ($this->nav_buttons()) {                  if ($this->nav_buttons()) {
                         if ($this->view_enabled()) {                          if ($this->view_enabled()) {
                                 echo '<input class="TODO-class"';                                  echo '<input class="',$this->getCSSclass('view', $position),'"';
                                 if (! $total_recs) { echo ' disabled'; }                                  if (! $total_recs) { echo ' disabled'; }
                                 echo ' type="submit" name="operation" value="'.$this->labels['View'].'">&nbsp;';                                  echo ' type="submit" name="operation" value="',$this->labels['View'],'">&nbsp;';
                         }                          }
                         if ($this->change_enabled()) {                          if ($this->change_enabled()) {
                                 echo '<input class="TODO-class"';                                  echo '<input class="',$this->getCSSclass('change', $position),'"';
                                 if (! $total_recs) { echo ' disabled'; }                                  if (! $total_recs) { echo ' disabled'; }
                                 echo ' type="submit" name="operation" value="'.$this->labels['Change'].'">&nbsp;';                                  echo ' type="submit" name="operation" value="',$this->labels['Change'],'">&nbsp;';
                         }                          }
                         if ($this->copy_enabled()) {                          if ($this->copy_enabled()) {
                                 echo '<input class="TODO-class"';                                  echo '<input class="',$this->getCSSclass('copy', $position),'"';
                                 if (! $total_recs) { echo ' disabled'; }                                  if (! $total_recs) { echo ' disabled'; }
                                 echo ' type="submit" name="operation" value="'.$this->labels['Copy'].'">&nbsp;';                                  echo ' type="submit" name="operation" value="',$this->labels['Copy'],'">&nbsp;';
                         }                          }
                         if ($this->delete_enabled()) {                          if ($this->delete_enabled()) {
                                 echo '<input class="TODO-class"';                                  echo '<input class="',$this->getCSSclass('delete', $position),'"';
                                 if (! $total_recs) { echo ' disabled'; }                                  if (! $total_recs) { echo ' disabled'; }
                                 echo ' type="submit" name="operation" value="'.$this->labels['Delete'].'">&nbsp;';                                  echo ' type="submit" name="operation" value="',$this->labels['Delete'],'">&nbsp;';
                         } // if else                          }
                 }                  }
   
                 $disabled = ($this->fm + $this->inc < $total_recs && ! $listall) ? '' : ' disabled';                  $disabled = ($this->fm + $this->inc < $total_recs && ! $listall) ? '' : ' disabled';
                 echo '<input'.$disabled.' class="TODO-class" type="submit" name="'.ltrim($disabled).'next" value="'                  echo '<input',$disabled,' class="',$this->getCSSclass('next', $position);
                         .$this->labels['Next'].'">';                  echo '" type="submit" name="',ltrim($disabled),'next" value="',$this->labels['Next'],'">';
   
                 // Message is now written here                  // Message is now written here
                 echo '</td><td class="TODO-class">'.$this->message.'</td>';                  echo '</td>',"\n";
                   echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n";
                 // display page and records statistics                  // Display page and records statistics
                 echo '<td class="TODO-class">' . "\n";                  echo '<td class="',$this->getCSSclass('stats', $position),'">',"\n";
                 if ($listall) {                  if ($listall) {
                         echo $this->labels['Page'].': 1 '.$this->labels['of'].' 1';                          echo $this->labels['Page'],':&nbsp;1&nbsp;',$this->labels['of'],'&nbsp;1';
                 } else {                  } else {
                         echo $this->labels['Page'].': ';                          echo $this->labels['Page'],':&nbsp;',($this->fm / $this->inc) + 1;
                         echo (($this->fm / $this->inc)+1);                          echo '&nbsp;',$this->labels['of'],'&nbsp;',max(1, ceil($total_recs / abs($this->inc)));
                         echo ' '.$this->labels['of'].' ';  
                         echo max(1, ceil($total_recs / abs($this->inc)));  
                 }                  }
                 echo '&nbsp;&nbsp;'.$this->labels['Records'].': '.$total_recs;                  echo '&nbsp; ',$this->labels['Records'],':&nbsp;',$total_recs;
                 echo '</td></tr></table>'."\n";                  echo '</td></tr></table>',"\n";
         } /* }}} */          } /* }}} */
   
         /*          /*
Line 1477  function phpMyEdit_form_control(theForm)
Line 1477  function phpMyEdit_form_control(theForm)
          */           */
         function display_record_buttons() /* {{{ */          function display_record_buttons() /* {{{ */
         {          {
                 echo '<table class="TODO-class">';                  echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n";
                 echo '<tr class="TODO-class"><td class="TODO-class">' . "\n";                  echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n";
                   echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n";
                 if ($this->change_operation()) {                  if ($this->change_operation()) {
                         echo '<input class="TODO-class" type="submit" name="savechange" value="'.$this->labels['Save'].'">'."\n";                          echo '<input class="',$this->getCSSclass('save', $position);
                         echo '<input class="TODO-class" type="submit" name="morechange" value="'.$this->labels['Apply'].'">'."\n";                          echo '" type="submit" name="savechange" value="',$this->labels['Save'],'">&nbsp;';
                         echo '<input class="TODO-class" type="button" name="cancel" value="'.$this->labels['Cancel'].'" onClick="form.submit();">'."\n";                          echo '<input class="',$this->getCSSclass('more', $position);
                           echo '" type="submit" name="morechange" value="',$this->labels['Apply'],'">&nbsp;';
                           echo '<input class="',$this->getCSSclass('cancel', $position);
                           echo '" type="button" name="cancel" value="',$this->labels['Cancel'];
                           echo '" onClick="form.submit();">',"\n";
                 } elseif ($this->add_operation()) {                  } elseif ($this->add_operation()) {
                         echo '<input class="TODO-class" type="submit" name="saveadd" value="'.$this->labels['Save'].'">'."\n";                          echo '<input class="',$this->getCSSclass('save', $position);
                         echo '<input class="TODO-class" type="submit" name="moreadd" value="'.$this->labels['More'].'">'."\n";                          echo '" type="submit" name="saveadd" value="',$this->labels['Save'],'">&nbsp;';
                         echo '<input class="TODO-class" type="button" name="cancel" value="'.$this->labels['Cancel'].'" onClick="form.submit();">'."\n";                          echo '<input class="',$this->getCSSclass('more', $position);
                           echo '" type="submit" name="moreadd" value="',$this->labels['More'],'">&nbsp;';
                           echo '<input class="',$this->getCSSclass('cancel', $position);
                           echo '" type="button" name="cancel" value="',$this->labels['Cancel'];
                           echo '" onClick="form.submit();">',"\n";
                 } elseif ($this->copy_operation()) {                  } elseif ($this->copy_operation()) {
                         echo '<input class="TODO-class" type="submit" name="saveadd" value="'.$this->labels['Save'].'">'."\n";                          echo '<input class="',$this->getCSSclass('save', $position);
                         echo '<input class="TODO-class" type="button" name="cancel" value="'.$this->labels['Cancel'].'" onClick="form.submit();">'."\n";                          echo '" type="submit" name="saveadd" value="',$this->labels['Save'],'">&nbsp;';
                           echo '<input class="',$this->getCSSclass('cancel', $position);
                           echo '" type="button" name="cancel" value="',$this->labels['Cancel'];
                           echo '" onClick="form.submit();">',"\n";
                 } elseif ($this->delete_operation()) {                  } elseif ($this->delete_operation()) {
                         echo '<input class="TODO-class" type="submit" name="savedelete" value="'.$this->labels['Delete'].'">'."\n";                          echo '<input class="',$this->getCSSclass('save', $position);
                         echo '<input class="TODO-class" type="submit" name="cancel" value="'.$this->labels['Cancel'].'">'."\n";                          echo '" type="submit" name="savedelete" value="',$this->labels['Delete'],'">&nbsp;';
                           echo '<input class="',$this->getCSSclass('cancel', $position);
                           echo '" type="button" name="cancel" value="',$this->labels['Cancel'];
                           echo '" onClick="form.submit();">',"\n";
                 } elseif ($this->view_operation()) {                  } elseif ($this->view_operation()) {
                         if ($this->change_enabled()) {                          if ($this->change_enabled()) {
                                 echo '<input class="TODO-class" type="submit" name="operation" value="'.$this->labels['Change'].'">'."\n";                                  echo '<input class="',$this->getCSSclass('save', $position);
                                   echo '" type="submit" name="operation" value="',$this->labels['Change'],'">&nbsp;';
                         }                          }
                         echo '<input class="TODO-class" type="submit" name="cancel" value="'.$this->labels['Cancel'].'">'."\n";                          echo '<input class="',$this->getCSSclass('cancel', $position);
                           echo '" type="submit" name="cancel" value="',$this->labels['Cancel'],'">',"\n";
                 }                  }
                 // Message is now written here                  // Message is now written here
                 echo '</td><td class="TODO-class">'.$this->message.'</td>';                  echo '</td>',"\n";
                   echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n";
                 echo '</td></tr></table>'."\n";                  echo '</td></tr></table>'."\n";
         } /* }}} */          } /* }}} */
   
Line 1510  function phpMyEdit_form_control(theForm)
Line 1528  function phpMyEdit_form_control(theForm)
          */           */
         function list_table() /* {{{ */          function list_table() /* {{{ */
         {          {
                   $this->page_type = ''; // empty string means list table
                 if ($this->fm == '') {                  if ($this->fm == '') {
                         $this->fm = 0;                          $this->fm = 0;
                 }                  }
Line 1537  function phpMyEdit_form_control(theForm)
Line 1556  function phpMyEdit_form_control(theForm)
                 $comp_ops = array(                  $comp_ops = array(
                                 ''=>'','<'=>'<','<='=>'<=',                                  ''=>'','<'=>'<','<='=>'<=',
                                 '='=>'=','>='=>'>=','>'=>'>');                                  '='=>'=','>='=>'>=','>'=>'>');
                 echo '<form class="TODO-class" action="',$this->page_name,'" method="POST">',"\n";                  echo '<form class="',$this->getCSSclass('form'),'" action="';
                   echo htmlspecialchars($this->page_name),'" method="POST">',"\n";
                 echo $this->get_origvars_html($this->get_sfn_cgi_vars());                  echo $this->get_origvars_html($this->get_sfn_cgi_vars());
                 echo '<input type="hidden" name="fl" value="'.$this->fl.'">'."\n";                  echo '<input type="hidden" name="fl" value="'.$this->fl.'">'."\n";
                 $prev_qfn   = $this->qfn;                  $prev_qfn   = $this->qfn;
Line 1563  function phpMyEdit_form_control(theForm)
Line 1583  function phpMyEdit_form_control(theForm)
                 $row = @mysql_fetch_array($res, MYSQL_ASSOC);                  $row = @mysql_fetch_array($res, MYSQL_ASSOC);
                 $total_recs = $row['num_rows'];                  $total_recs = $row['num_rows'];
                 if ($this->nav_up()) {                  if ($this->nav_up()) {
                         $this->display_list_table_buttons($total_recs);                          $this->display_list_table_buttons($total_recs, 'up');
                         echo '<hr class="TODO-class">'."\n";                          echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n";
                 }                  }
                 if ($this->cgi['persist'] != '') {                  if ($this->cgi['persist'] != '') {
                         echo $this->get_origvars_html($this->cgi['persist']);                          echo $this->get_origvars_html($this->cgi['persist']);
Line 1572  function phpMyEdit_form_control(theForm)
Line 1592  function phpMyEdit_form_control(theForm)
                 if (!$this->fl) {                  if (!$this->fl) {
                         echo($hidden_qfs);                          echo($hidden_qfs);
                 }                  }
                 echo '<input type=hidden name=qfn value="'.htmlspecialchars($this->qfn).'">'."\n";                  echo '<input type=hidden name=qfn value="',htmlspecialchars($this->qfn),'">',"\n";
                 echo '<input type=hidden name=fm value="'.htmlspecialchars($this->fm).'">'."\n";                  echo '<input type=hidden name=fm value="',htmlspecialchars($this->fm),'">',"\n";
                 echo '<table class="TODO-class" summary="',$this->tb,'">',"\n";                  echo '<table class="'.$this->getCSSclass('main').'" summary="',$this->tb,'">',"\n";
                 echo '<tr class="TODO-class">',"\n";                  echo '<tr class="',$this->getCSSclass('header'),'">',"\n";
                 /*                  /*
                  * System (navigation, selection) columns counting                   * System (navigation, selection) columns counting
                  */                   */
Line 1590  function phpMyEdit_form_control(theForm)
Line 1610  function phpMyEdit_form_control(theForm)
                  * if we have filters, Changes or Deletes enabled                   * if we have filters, Changes or Deletes enabled
                  */                   */
                 if ($sys_cols) {                  if ($sys_cols) {
                         echo '<th class="TODO-class" colspan="'.$sys_cols.'">';                          echo '<th class="',$this->getCSSclass('header'),'" colspan="',$sys_cols,'">';
                         if ($this->filter_enabled()) {                          if ($this->filter_enabled()) {
                                 if ($this->fl) {                                  if ($this->fl) {
                                         echo '<input class="TODO-class" type=submit name=sw value="'.$this->labels['Hide'].'">';                                          echo '<input class="',$this->getCSSclass('hide'),'" type=submit name=sw value="';
                                         echo '<input class="TODO-class" type=submit name=sw value="'.$this->labels['Clear'].'">';                                          echo $this->labels['Hide'],'">';
                                           echo '<input class="',$this->getCSSclass('clear'),'" type=submit name=sw value="';
                                           echo $this->labels['Clear'],'">';
                                 } else {                                  } else {
                                         echo '<input class="TODO-class" type=submit name=sw value="'.$this->labels['Search'].'">';                                          echo '<input class="',$this->getCSSclass('search'),'" type=submit name=sw value="';
                                           echo $this->labels['Search'],'">';
                                 }                                  }
                         } else {                          } else {
                                 echo '&nbsp;';                                  echo '&nbsp;';
Line 1609  function phpMyEdit_form_control(theForm)
Line 1632  function phpMyEdit_form_control(theForm)
                                 $fdn = $this->fdd[$fd]['name'];                                  $fdn = $this->fdd[$fd]['name'];
                                 $w   = isset($this->fdd[$fd]['width']) ? ' width="'.$this->fdd[$fd]['width'].'"' : '';                                  $w   = isset($this->fdd[$fd]['width']) ? ' width="'.$this->fdd[$fd]['width'].'"' : '';
                                 if (! $this->fdd[$fd]['sort'] || $this->hidden($fd) || $this->password($fd)) {                                  if (! $this->fdd[$fd]['sort'] || $this->hidden($fd) || $this->password($fd)) {
                                         echo '<th'.$w.' class="TODO-class">'.$fdn.'</th>'."\n";                                          echo '<th',$w,' class="',$this->getCSSclass('header'),'">',$fdn,'</th>',"\n";
                                 } else {                                  } else {
                                         // Clicking on the current sort field reverses the sort order                                          // Clicking on the current sort field reverses the sort order
                                         $new_sfn = $this->sfn;                                          $new_sfn = $this->sfn;
                                         array_unshift($new_sfn, in_array("$k", $new_sfn, 1) ? "-$k" : $k);                                          array_unshift($new_sfn, in_array("$k", $new_sfn, 1) ? "-$k" : $k);
                                         echo '<th'.$w.' class="TODO-class"><a class="TODO-class" href="';                                          echo '<th',$w,' class="',$this->getCSSclass('header'),'">';
                                           echo '<a class="',$this->getCSSclass('header'),'" href="';
                                         echo htmlspecialchars($this->page_name.'?fm=0&fl='.$this->fl.'&'                                          echo htmlspecialchars($this->page_name.'?fm=0&fl='.$this->fl.'&'
                                                         .$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist'].$this->qfn);                                                          .$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist'].$this->qfn);
                                         echo '">',$fdn,'</a></th>',"\n";                                          echo '">',$fdn,'</a></th>',"\n";
                                 }                                  }
                         }                          }
                 }                  }
                 echo '</tr>'."\n";                  echo '</tr>',"\n";
   
                 /*                  /*
                  * Prepare the SQL Query from the data definition file                   * Prepare the SQL Query from the data definition file
Line 1717  function phpMyEdit_form_control(theForm)
Line 1741  function phpMyEdit_form_control(theForm)
                                 $fields = array_flip(array_keys($filter_row));                                  $fields = array_flip(array_keys($filter_row));
                         }                          }
                         if ($fields != false) {                          if ($fields != false) {
                                 echo '<tr class="TODO-class">';                                  echo '<tr class="',$this->getCSSclass('filter'),'">';
                                 echo '<td class="TODO-class" colspan="',$sys_cols,'">';                                  echo '<td class="',$this->getCSSclass('filter'),'" colspan="',$sys_cols,'">';
                                 echo '<input class="TODO-class" type="submit" name="filter" value="'                                  echo '<input class="',$this->getCSSclass('filter'),'" type="submit" name="filter" value="';
                                         .$this->labels['Query'].'"></td>'."\n";                                  echo $this->labels['Query'],'"></td>',"\n";
   
                                 for ($k = 0; $k < $this->num_fds; $k++) {                                  for ($k = 0; $k < $this->num_fds; $k++) {
                                         $this->field_name = $this->fds[$k];                                          $this->field_name = $this->fds[$k];
                                         $fd               = $this->field_name;                                          $fd               = $this->field_name;
Line 1732  function phpMyEdit_form_control(theForm)
Line 1755  function phpMyEdit_form_control(theForm)
                                         $m  = $this->get_cgi_var($l,  '');                                          $m  = $this->get_cgi_var($l,  '');
                                         $mc = $this->get_cgi_var($lc, '');                                          $mc = $this->get_cgi_var($lc, '');
                                         $mi = $this->get_cgi_var($li, '');                                          $mi = $this->get_cgi_var($li, '');
                                           $css_class_name = $this->getCSSclass('filter');
   
                                         if (isset($this->fdd[$fd]['width'])) {                                          if (isset($this->fdd[$fd]['width'])) {
                                                 $widthStyle = ' STYLE=\'width: "'.(6*$this->fdd[$fd]['width']).'px"\'';                                                  $widthStyle = ' STYLE=\'width: "'.(6*$this->fdd[$fd]['width']).'px"\'';
                                         }                                          }
                                         $opened = false;                                          $opened = false;
                                         if ($this->displayed[$k]) {                                          if ($this->displayed[$k]) {
                                                 echo '<td'.$widthStyle.'>';                                                  echo '<td',$widthStyle,' class="',$css_class_name,'">';
                                                 $opened = true;                                                  $opened = true;
                                         }                                          }
                                         $type = $this->fdd[$fd]['type'];                                          $type = $this->fdd[$fd]['type'];
Line 1758  function phpMyEdit_form_control(theForm)
Line 1782  function phpMyEdit_form_control(theForm)
                                                 $x = isset($this->fdd[$k]['values']['table']) || !$this->col_has_values($k)                                                  $x = isset($this->fdd[$k]['values']['table']) || !$this->col_has_values($k)
                                                         ? $this->set_values_from_table($k, array('*' => '*'))                                                          ? $this->set_values_from_table($k, array('*' => '*'))
                                                         : array('*' => '*') + (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values'];                                                          : array('*' => '*') + (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values'];
                                                 echo $this->htmlSelect($l.'_id', $x, $selected, $multiple);                                                  echo $this->htmlSelect($l.'_id', $css_class_name, $x, $selected, $multiple);
                                         } elseif ($this->fdd[$fd]['select'] == 'T') {                                          } elseif ($this->fdd[$fd]['select'] == 'T') {
                                                 // This is where we put the comparison selects                                                  // This is where we put the comparison selects
                                                 if (! $this->password($k) && ! $this->hidden($k)) {                                                  if (! $this->password($k) && ! $this->hidden($k)) {
Line 1772  function phpMyEdit_form_control(theForm)
Line 1796  function phpMyEdit_form_control(theForm)
                                                         }                                                          }
                                                         if ($this->col_is_string($k)) {                                                          if ($this->col_is_string($k)) {
                                                                 // it's treated as a string                                                                  // it's treated as a string
                                                                 echo '<input class="TODO-class" type="text" name="qf'.$k.'"';                                                                  echo '<input class="',$css_class_name,'" value="';
                                                                 echo ' value="'.htmlspecialchars($m).'"'.$size_ml_props.'>';                                                                  echo htmlspecialchars($m),'" type="text" name="qf',$k,'"',$size_ml_props,'>';
                                                         } elseif ($this->col_is_date($k)) {                                                          } elseif ($this->col_is_date($k)) {
                                                                 // it's a date                                                                  // it's a date
                                                                 // it's treated as a string                                                                  // it's treated as a string
                                                                 echo '<input class="TODO-class" type="text" name="qf'.$k.'"';                                                                  echo '<input class="',$css_class_name,'" value="';
                                                                 echo ' value="'.htmlspecialchars($m).'"'.$size_ml_props.'>';                                                                  echo htmlspecialchars($m),'" type="text" name="qf',$k,'"',$size_ml_props,'>';
                                                         } elseif ($this->col_is_number($k)) {                                                          } elseif ($this->col_is_number($k)) {
                                                                 // it's a number                                                                  // it's a number
                                                                 echo $this->htmlSelect($l.'_comp',$comp_ops,$mc);                                                                  echo $this->htmlSelect($l.'_comp', $css_class_name, $comp_ops, $mc);
                                                                 // it's treated as a string                                                                  // it's treated as a string
                                                                 echo '<input class="TODO-class" type="text" name="qf'.$k.'"'                                                                  echo '<input class="',$css_class_name,'" value="';
                                                                         .' value="'.htmlspecialchars($m).'"'.$size_ml_props.'>';                                                                  echo htmlspecialchars($m),'" type="text" name="qf',$k,'"',$size_ml_props,'>';
                                                         } else {                                                          } else {
                                                                 // type is 'unknown' or not set, it's treated as a string                                                                  // type is 'unknown' or not set, it's treated as a string
                                                                 echo '<input class="TODO-class" type="text" name="qf'.$k.'"';                                                                  echo '<input class="',$css_class_name,'" value="';
                                                                 echo ' value="'.htmlspecialchars($m).'"'.$size_ml_props.'>';                                                                  echo htmlspecialchars($m),'" type="text" name="qf',$k,'"',$size_ml_props,'>';
                                                         }                                                          }
                                                 } else {                                                  } else {
                                                         echo '&nbsp;';                                                          echo '&nbsp;';
                                                 }                                                  }
                                                 echo '</td>'."\n";                                                  echo '</td>',"\n";
                                         } else {                                          } else {
                                                 echo '<td class="TODO-class">&nbsp;</td>'."\n";                                                  echo '<td class="',$css_class_name,'">&nbsp;</td>',"\n";
                                         }                                          }
                                 }                                  }
                                 echo '</tr>'."\n";                                  echo '</tr>',"\n";
                         }                          }
                 } // }}}                  } // }}}
   
Line 1806  function phpMyEdit_form_control(theForm)
Line 1830  function phpMyEdit_form_control(theForm)
                  * Display sorting sequence                   * Display sorting sequence
                  */                   */
                 if ($qparts['orderby'] && $this->display['sort']) {                  if ($qparts['orderby'] && $this->display['sort']) {
                         echo '<tr class="TODO-class"><td class="TODO-class" colspan=',$sys_cols,'>','<a class="TODO-class" href="';                          $css_class_name = $this->getCSSclass('sortinfo');
                           echo '<tr class="',$css_class_name,'">',"\n";
                           echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';
                           echo '<a class="',$css_class_name,'" href="';
                         echo htmlspecialchars($this->get_server_var('PHP_SELF').'?fl='.$this->fl.'&fm='.$this->fm                          echo htmlspecialchars($this->get_server_var('PHP_SELF').'?fl='.$this->fl.'&fm='.$this->fm
                                         .$this->qfn.$this->cgi['persist']);                                          .$this->qfn.$this->cgi['persist']);
                         echo '">',$this->labels['Clear'],'</a></td>',"\n";                          echo '">',$this->labels['Clear'],'</a></td>',"\n";
                         echo '<td class="TODO-class" colspan="'.$this->num_fields_displayed.'">',$this->labels['Sorted By'];                          echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">';
                         echo ':',join(', ', $sort_fields_w),'</td></tr>',"\n";                          echo $this->labels['Sorted By'],':',join(', ', $sort_fields_w),'</td></tr>',"\n";
                 }                  }
   
                 /*                  /*
Line 1819  function phpMyEdit_form_control(theForm)
Line 1846  function phpMyEdit_form_control(theForm)
                  */                   */
                 $text_query = $this->make_where_from_query_opts(null, true);                  $text_query = $this->make_where_from_query_opts(null, true);
                 if ($text_query != '' && $this->display['query']) {                  if ($text_query != '' && $this->display['query']) {
                         echo '<tr class="TODO-class"><td class="TODO-class" colspan=',$sys_cols,'>','<a class="TODO-class" href="';                          $css_class_name = $this->getCSSclass('queryinfo');
                           echo '<tr class="',$css_class_name,'">',"\n";
                           echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';
                           echo '<a class="',$css_class_name,'" href="';
                         echo htmlspecialchars($this->get_server_var('PHP_SELF').'?fl='.$this->fl.'&fm='.$this->fm                          echo htmlspecialchars($this->get_server_var('PHP_SELF').'?fl='.$this->fl.'&fm='.$this->fm
                                         .'&'.$this->get_sfn_cgi_vars().$this->cgi['persist']);                                          .'&'.$this->get_sfn_cgi_vars().$this->cgi['persist']);
                         echo '">',$this->labels['Clear'],'</a></td>',"\n";                          echo '">',$this->labels['Clear'],'</a></td>',"\n";
                         echo '<td class="TODO-class" colspan="',$this->num_fields_displayed.'">',$this->labels['Current Query'];                          echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">';
                         echo ': ',htmlspecialchars($text_query),'</td></tr>',"\n";                          echo $this->labels['Current Query'],': ',htmlspecialchars($text_query),'</td></tr>',"\n";
                 }                  }
   
                 if ($this->nav_text_links() || $this->nav_graphic_links()) {                  if ($this->nav_text_links() || $this->nav_graphic_links()) {
Line 1853  function phpMyEdit_form_control(theForm)
Line 1883  function phpMyEdit_form_control(theForm)
                 while ((!$fetched && ($row = @mysql_fetch_array($res, MYSQL_ASSOC)) != false)                  while ((!$fetched && ($row = @mysql_fetch_array($res, MYSQL_ASSOC)) != false)
                                 || ($fetched && $row != false)) {                                  || ($fetched && $row != false)) {
                         $fetched = false;                          $fetched = false;
                         echo '<tr class="TODO-class">',"\n";                          echo '<tr class="',$this->getCSSclass('row', '', true),'">',"\n";
                         if ($sys_cols) {                          if ($sys_cols) {
                                 $key_rec    = $row['qf'.$this->key_num];                                  $key_rec    = $row['qf'.$this->key_num];
                                 $qviewStr   = $qpviewStr   . '&rec='.$key_rec;                                  $qviewStr   = $qpviewStr   . '&rec='.$key_rec;
                                 $qcopyStr   = $qpcopyStr   . '&rec='.$key_rec;                                  $qcopyStr   = $qpcopyStr   . '&rec='.$key_rec;
                                 $qchangeStr = $qpchangeStr . '&rec='.$key_rec;                                  $qchangeStr = $qpchangeStr . '&rec='.$key_rec;
                                 $qdeleteStr = $qpdeleteStr . '&rec='.$key_rec;                                  $qdeleteStr = $qpdeleteStr . '&rec='.$key_rec;
                                   $css_class_name = $this->getCSSclass('navigation', '', true);
                                 if ($select_recs) {                                  if ($select_recs) {
                                         if (! $this->nav_buttons() || $sys_cols > 1) {                                          if (! $this->nav_buttons() || $sys_cols > 1) {
                                                 echo '<td class="TODO-class">';                                                  echo '<td class="',$css_class_name,'">';
                                         }                                          }
                                         if ($this->nav_graphic_links()) {                                          if ($this->nav_graphic_links()) {
                                                 $printed_out = false;                                                  $printed_out = false;
                                                 if ($this->view_enabled()) {                                                  if ($this->view_enabled()) {
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="';                                                          echo '<a class="',$css_class_name,'" href="';
                                                         echo htmlspecialchars($this->page_name.$qviewStr);                                                          echo htmlspecialchars($this->page_name.$qviewStr),'"><img class="';
                                                         echo '"><img class="TODO-class" src="'.$this->url['images'].'pme-view.png"';                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo ' height="15" width="16" border="0" alt="'                                                          echo 'pme-view.png" height="15" width="16" border="0" alt="';
                                                                 .htmlspecialchars($this->labels['View']).'"></a>';                                                          echo htmlspecialchars($this->labels['View']),'"></a>';
                                                 }                                                  }
                                                 if ($this->change_enabled()) {                                                  if ($this->change_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="';                                                          echo '<a class="',$css_class_name,'" href="';
                                                         echo htmlspecialchars($this->page_name.$qchangeStr);                                                          echo htmlspecialchars($this->page_name.$qchangeStr),'"><img class="';
                                                         echo '"><img class="TODO-class" src="'.$this->url['images'].'pme-change.png"';                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo ' height="15" width="16" border="0" alt="'                                                          echo 'pme-change.png" height="15" width="16" border="0" alt="';
                                                                 .htmlspecialchars($this->labels['Change']).'"></a>';                                                          echo htmlspecialchars($this->labels['Change']),'"></a>';
                                                 }                                                  }
                                                 if ($this->copy_enabled()) {                                                  if ($this->copy_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="';                                                          echo '<a class="',$css_class_name,'" href="';
                                                         echo htmlspecialchars($this->page_name.$qcopyStr);                                                          echo htmlspecialchars($this->page_name.$qcopyStr),'"><img class="';
                                                         echo '"><img class="TODO-class" src="'.$this->url['images'].'pme-copy.png"';                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo ' height="15" width="16" border="0" alt="'                                                          echo 'pme-copy.png" height="15" width="16" border="0" alt="';
                                                                 .htmlspecialchars($this->labels['Copy']).'"></a>';                                                          echo htmlspecialchars($this->labels['Copy']),'"></a>';
                                                 }                                                  }
                                                 if ($this->delete_enabled()) {                                                  if ($this->delete_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="';                                                          echo '<a class="',$css_class_name,'" href="';
                                                         echo htmlspecialchars($this->page_name.$qdeleteStr);                                                          echo htmlspecialchars($this->page_name.$qdeleteStr),'"><img class="';
                                                         echo '"><img class="TODO-class" src="'.$this->url['images'].'pme-delete.png"';                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo ' height="15" width="16" border="0" alt="'                                                          echo 'pme-delete.png" height="15" width="16" border="0" alt="';
                                                                 .htmlspecialchars($this->labels['Delete']).'"></a>';                                                          echo htmlspecialchars($this->labels['Delete']),'"></a>';
                                                 }                                                  }
                                         }                                          }
                                         if ($this->nav_text_links()) {                                          if ($this->nav_text_links()) {
                                                 if ($this->nav_graphic_links()) {                                                  if ($this->nav_graphic_links()) {
                                                         echo '<br class="TODO-class">';                                                          echo '<br class="',$css_class_name,'">';
                                                 }                                                  }
                                                 $printed_out = false;                                                  $printed_out = false;
                                                 if ($this->view_enabled()) {                                                  if ($this->view_enabled()) {
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="'                                                          echo '<a class="',$css_class_name,'" href="';
                                                                 .htmlspecialchars($this->page_name.$qviewStr).'">V</a>&nbsp;';                                                          echo htmlspecialchars($this->page_name.$qviewStr),'">V</a>&nbsp;';
                                                 }                                                  }
                                                 if ($this->change_enabled()) {                                                  if ($this->change_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="'                                                          echo '<a class="',$css_class_name,'" href="';
                                                                 .htmlspecialchars($this->page_name.$qchangeStr).'">C</a>&nbsp;';                                                          echo htmlspecialchars($this->page_name.$qchangeStr),'">C</a>&nbsp;';
                                                 }                                                  }
                                                 if ($this->copy_enabled()) {                                                  if ($this->copy_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="'                                                          echo '<a class="',$css_class_name,'" href="';
                                                                 .htmlspecialchars($this->page_name.$qcopyStr).'">P</a>&nbsp;';                                                          echo htmlspecialchars($this->page_name.$qcopyStr),'">P</a>&nbsp;';
                                                 }                                                  }
                                                 if ($this->delete_enabled()) {                                                  if ($this->delete_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
                                                         $printed_out = true;                                                          $printed_out = true;
                                                         echo '<a class="TODO-class" href="'                                                          echo '<a class="',$css_class_name,'" href="';
                                                                 .htmlspecialchars($this->page_name.$qdeleteStr).'">D</a>';                                                          echo htmlspecialchars($this->page_name.$qdeleteStr),'">D</a>';
                                                 }                                                  }
                                         }                                          }
                                         if (! $this->nav_buttons() || $sys_cols > 1) {                                          if (! $this->nav_buttons() || $sys_cols > 1) {
                                                 echo '</td>'."\n";                                                  echo '</td>'."\n";
                                         }                                          }
                                         if ($this->nav_buttons()) {                                          if ($this->nav_buttons()) {
                                                 echo '<td class="TODO-class">';                                                  echo '<td class="',$css_class_name,'"><input class="',$css_class_name;
                                                 echo '<input class="TODO-class" type=radio name=rec value="'.htmlspecialchars($key_rec).'"';                                                  echo '" type=radio name=rec value="',htmlspecialchars($key_rec),'"';
                                                 if ($first) {                                                  if ($first) {
                                                         echo ' checked';                                                          echo ' checked';
                                                         $first = false;                                                          $first = false;
                                                 }                                                  }
                                                 echo '></td>'."\n";                                                  echo '></td>',"\n";
                                         }                                          }
                                 } elseif ($this->filter_enabled()) {                                  } elseif ($this->filter_enabled()) {
                                         echo '<td class="TODO-class" colspan='.$sys_cols.'>&nbsp;</td>'."\n";                                          echo '<td class="',$css_class_name,'" colspan=',$sys_cols,'>&nbsp;</td>',"\n";
                                 }                                  }
                         }                          }
                         // Calculate the url query string for optional URL support                          // Calculate the url query string for optional URL support
Line 1957  function phpMyEdit_form_control(theForm)
Line 1988  function phpMyEdit_form_control(theForm)
                                 if (! $this->displayed[$k]) {                                  if (! $this->displayed[$k]) {
                                         continue;                                          continue;
                                 }                                  }
                                   $css_class_name = $this->getCSSclass('cell', '', true);
                                 if ($this->hidden($k) || $this->password($k)) {                                  if ($this->hidden($k) || $this->password($k)) {
                                         echo '<td class="TODO-class">'.$this->labels['hidden'].'</td>'."\n";                                          echo '<td class="',$css_class_name,'">',$this->labels['hidden'],'</td>',"\n";
                                         continue;                                          continue;
                                 }                                  }
                                 // display the contents                                  // display the contents
Line 1970  function phpMyEdit_form_control(theForm)
Line 2002  function phpMyEdit_form_control(theForm)
                                 if (isset($this->fdd[$fd]['width'])) {                                  if (isset($this->fdd[$fd]['width'])) {
                                         $colattrs .= ' width="'.$this->fdd[$fd]['width'].'"';                                          $colattrs .= ' width="'.$this->fdd[$fd]['width'].'"';
                                 }                                  }
                                 echo '<td class="TODO-class"'.$colattrs.'>';                                  echo '<td class="',$css_class_name,'"',$colattrs,'>';
                                 // displayable                                  // displayable
                                 if (isset($this->fdd[$k]['URL'])                                  if (isset($this->fdd[$k]['URL'])
                                                 || isset($this->fdd[$k]['URLprefix'])                                                  || isset($this->fdd[$k]['URLprefix'])
Line 1999  function phpMyEdit_form_control(theForm)
Line 2031  function phpMyEdit_form_control(theForm)
                                         } else {                                          } else {
                                                 $urllink = htmlspecialchars($urllink);                                                  $urllink = htmlspecialchars($urllink);
                                                 $urldisp = htmlspecialchars($urldisp);                                                  $urldisp = htmlspecialchars($urldisp);
                                                 echo '<a '.$target.'class="TODO-class" href="'.$urllink.'">'.$urldisp.'</a>';                                                  echo '<a ',$target,'class="',$css_class_name,'" href="',$urllink,'">',$urldisp,'</a>';
                                         }                                          }
                                 } elseif (isset($this->fdd[$k]['datemask'])) {                                  } elseif (isset($this->fdd[$k]['datemask'])) {
                                         $shortdisp = $row["qf$k"];                                          $shortdisp = $row["qf$k"];
Line 2082  function phpMyEdit_form_control(theForm)
Line 2114  function phpMyEdit_form_control(theForm)
                 }                  }
                 echo '</table>'."\n"; // end of table rows listing                  echo '</table>'."\n"; // end of table rows listing
                 if ($this->nav_down()) {                  if ($this->nav_down()) {
                         echo '<hr class="TODO-class">'."\n";                          echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n";
                         $this->display_list_table_buttons($total_recs);                          $this->display_list_table_buttons($total_recs, 'down');
                 }                  }
                 echo '</form>'."\n";                  echo '</form>'."\n";
         } /* }}} */          } /* }}} */
   
         function display_record() /* {{{ */          function display_record() /* {{{ */
         {          {
                   switch ($this->operation) {
                           case $this->labels['Add']:    $this->page_type = 'add';    break;
                           case $this->labels['Change']: $this->page_type = 'change'; break;
                           case $this->labels['Copy']:   $this->page_type = 'copy';   break;
                           case $this->labels['Delete']: $this->page_type = 'delete'; break;
                           case $this->labels['View']:   $this->page_type = 'view';   break;
                           default: $this->page_type = '';
                   }
                 $this->create_javascripts();                  $this->create_javascripts();
                 if ($this->cgi['persist'] != '') {                  if ($this->cgi['persist'] != '') {
                         echo $this->get_origvars_html($this->cgi['persist']);                          echo $this->get_origvars_html($this->cgi['persist']);
Line 2102  function phpMyEdit_form_control(theForm)
Line 2142  function phpMyEdit_form_control(theForm)
                 echo '<input type="hidden" name="fl" value="'.$this->fl.'">'."\n";                  echo '<input type="hidden" name="fl" value="'.$this->fl.'">'."\n";
                 if ($this->nav_up()) {                  if ($this->nav_up()) {
                         $this->display_record_buttons();                          $this->display_record_buttons();
                         echo '<hr class="TODO-class">'."\n";                          echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n";
                 }                  }
                 echo '<table class="TODO-class" summary="'.$this->tb.'">'."\n";                  echo '<table class="'.$this->getCSSclass('main').'" summary="',$this->tb,'">',"\n";
                 if ($this->add_operation()) {                  if ($this->add_operation()) {
                         $this->display_add_record();                          $this->display_add_record();
                 } else {                  } else {
Line 2112  function phpMyEdit_form_control(theForm)
Line 2152  function phpMyEdit_form_control(theForm)
                 }                  }
                 echo '</table>'."\n";                  echo '</table>'."\n";
                 if ($this->nav_down()) {                  if ($this->nav_down()) {
                         echo '<hr class="TODO-class">'."\n";                          echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n";
                         $this->display_record_buttons();                          $this->display_record_buttons();
                 }                  }
                 echo '</form>'."\n";                  echo '</form>'."\n";
Line 2685  function phpMyEdit_form_control(theForm)
Line 2725  function phpMyEdit_form_control(theForm)
                 isset($opts['url']['images']) && $this->url['images'] = $opts['url']['images'];                  isset($opts['url']['images']) && $this->url['images'] = $opts['url']['images'];
                 // CSS classes policy                  // CSS classes policy
                 $this->css = @$opts['css'];                  $this->css = @$opts['css'];
                 empty($this->css['prefix'])    && $this->css['prefix']    = 'pme';                  !isset($this->css['separator']) && $this->css['separator'] = '-';
                 empty($this->css['separator']) && $this->css['separator'] = '-';                  !isset($this->css['prefix'])    && $this->css['prefix']    = 'pme';
                   !isset($this->css['page_type']) && $this->css['page_type'] = false;
                   !isset($this->css['position'])  && $this->css['position']  = true;
                 $this->css['dividor'] = intval(@$this->css['dividor']);                  $this->css['dividor'] = intval(@$this->css['dividor']);
                 // Navigation                  // Navigation
                 $this->navigation = @$opts['navigation'];                  $this->navigation = @$opts['navigation'];

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top