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

Diff for phpMyEdit/phpMyEdit.class.php between version 1.28 and 1.29

version 1.28, 2002/11/14 23:29:58 version 1.29, 2002/11/18 20:49:30
Line 19 
Line 19 
  * http://www.platon.sk/projects/phpMyEdit/   * http://www.platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.27 2002/11/12 21:41:43 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.28 2002/11/14 23:29:58 nepto Exp $ */
   
 /*      phpMyEdit intro {{{ */  /*      phpMyEdit intro {{{ */
 /*  /*
Line 802  function form_control(theForm)
Line 802  function form_control(theForm)
                         echo '  </tr>'."\n";                          echo '  </tr>'."\n";
                 }                  }
                 for ($k = 0; $k < $this->num_fds; $k++) {                  for ($k = 0; $k < $this->num_fds; $k++) {
                           if (! $this->displayed[$k]) {
                                   continue;
                           }
                         echo '<tr>'."\n";                          echo '<tr>'."\n";
                         if ($this->displayed[$k]) {                          echo '<td>'.$this->fdd[$k]['name'].'</td>'."\n";
                                 echo '<td>'.$this->fdd[$k]['name'].'</td>'."\n";  
   
                                 if ($this->fdd[$k]['select'] == 'M')                          if ($this->fdd[$k]['select'] != 'M') { $a=''; }
                                 { $a = ' multiple size="'.$this->multiple.'"'; } else { $a=''; }                          else { $a = ' multiple size="'.$this->multiple.'"'; }
                                 if ($this->col_has_values($k)) {                          if ($this->col_has_values($k)) {
                                         echo '    <td>' ."\n";                                  echo '    <td>' ."\n";
                                         $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, '', $this->col_is_set($k));                                  echo $this->htmlSelect($this->fds[$k], $vals, '', $this->col_is_set($k));
                                         echo '</td>'."\n";                                  echo '</td>'."\n";
                                 } elseif (isset ($this->fdd[$k]['textarea'])) {                          } elseif (isset ($this->fdd[$k]['textarea'])) {
                                         echo '<td><textarea ';                                  echo '<td><textarea ';
                                         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></td>'."\n";
                           } else {
                                   // Simple edit box required
                                   $type = $this->fdd[$k]['type'];
                                   echo '<td>';
                                   if ($this->readonly($k)) {
                                           echo $this->htmlDisplay($this->fdd[$k], '', false, false, false)
                                                   .'<input type="hidden" name="'
                                                   .$this->fds[$k]
                                                   .'" value="'
                                                   .$this->htmlDisplay($this->fdd[$k], $this->fdd[$k]['default'],
                                                                   false, false, false)
                                                   .'" />';
                                 } else {                                  } else {
                                         // Simple edit box required                                          if ($this->col_is_string($k) || $this->col_is_number($k)) {
                                         $type = $this->fdd[$k]['type'];                                                  // string type
                                         echo '<td>';                                                  $maxwidth = intval($this->fdd[$k]['maxlen']);
                                         if ($this->readonly($k)) {                                                  $size = min(60,$maxwidth);
                                                 echo $this->htmlDisplay($this->fdd[$k], '', false, false, false)                                                  echo '<input type="text" name="'.$this->fds[$k]
                                                         .'<input type="hidden" name="'                                                          .'" size="'.$size.'" maxlength="'.$maxwidth.'" value="'
                                                         .$this->fds[$k]                                                          .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],
                                                         .'" value="'                                                                          false, false, false)
                                                         .$this->htmlDisplay($this->fdd[$k], $this->fdd[$k]['default'],                                                          .'" />';
                                           } elseif ($this->col_is_date($k)) {
                                                   // date type, get date components
                                                   //if ($this->fdd[$k]['default'])
                                                   //      $value = $this->mdate_set($this->fdd[$k]['default'],$this->fdd[$k]['type']);
                                                   //$value = time();
                                                   //echo $this->mdate_disperse($k,$value,true);
                                                   // string type
                                                   $maxwidth = intval($this->fdd[$k]['maxlen']);
                                                   $size = min(60, $maxwidth);
                                                   echo '<input type="text" name="'.$this->fds[$k]
                                                           .'" size="'.$size.'" maxlength="'.$maxwidth.'" value="'
                                                           .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],
                                                                         false, false, false)                                                                          false, false, false)
                                                         .'" />';                                                          .'" />';
                                         } else {                                          } else {
                                                 if ($this->col_is_string($k) || $this->col_is_number($k)) {                                                  // unknown type
                                                         // string type                                                  echo '<input type="text" name="'.$this->fds[$k].'" value="'
                                                         $maxwidth = intval($this->fdd[$k]['maxlen']);                                                          .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],
                                                         $size = min(60,$maxwidth);                                                                          false, false, false)
                                                         echo '<input type="text" name="'.$this->fds[$k]                                                          .'" />';
                                                                 .'" size="'.$size.'" maxlength="'.$maxwidth.'" value="'  
                                                                 .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],  
                                                                                 false, false, false)  
                                                                 .'" />';  
                                                 } elseif ($this->col_is_date($k)) {  
                                                         // date type, get date components  
                                                         //if ($this->fdd[$k]['default'])  
                                                         //      $value = $this->mdate_set($this->fdd[$k]['default'],$this->fdd[$k]['type']);  
                                                         //$value = time();  
                                                         //echo $this->mdate_disperse($k,$value,true);  
                                                         // string type  
                                                         $maxwidth = intval($this->fdd[$k]['maxlen']);  
                                                         $size = min(60, $maxwidth);  
                                                         echo '<input type="text" name="'.$this->fds[$k]  
                                                                 .'" size="'.$size.'" maxlength="'.$maxwidth.'" value="'  
                                                                 .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],  
                                                                                 false, false, false)  
                                                                 .'" />';  
                                                 } else {  
                                                         // unknown type  
                                                         echo '<input type="text" name="'.$this->fds[$k].'" value="'  
                                                                 .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],  
                                                                                 false, false, false)  
                                                                 .'" />';  
                                                 }  
                                         }                                          }
                                         echo '</td>';  
                                 } // if elseif else  
                                 if ($this->guidance) {  
                                         if ($this->fdd[$k]['help'])  
                                                 echo '<td>'.$this->fdd[$k]['help'].'</td>'."\n";  
                                 } else {  
                                         echo "<td>&nbsp;</td>\n";  
                                 }                                  }
                                 echo '</tr>'."\n";                                  echo '</td>';
                           } // if elseif else
                           if ($this->guidance) {
                                   if ($this->fdd[$k]['help'])
                                           echo '<td>'.$this->fdd[$k]['help'].'</td>'."\n";
                           } else {
                                   echo "<td>&nbsp;</td>\n";
                         }                          }
                 } // for k < this->num_fds                          echo '</tr>'."\n";
                   } // for()
         } // display_add_record  /* }}} */          } // display_add_record  /* }}} */
   
         function display_copy_change_delete_record() /* {{{ */          function display_copy_change_delete_record() /* {{{ */
Line 1524  function form_control(theForm)
Line 1525  function form_control(theForm)
                         echo '<hr>';                          echo '<hr>';
                 }                  }
   
                 //display buttons at top of page - sparky                  // Display buttons at top and/or bottom of page.
                 // setup query to get num_rows                  // Setup query to get num_rows. (sparky)
                 $total_recs  = 0;                  $total_recs  = 0;
                 $count_parts = array(                  $count_parts = array(
                                 'type'   => 'select',                                  'type'   => 'select',
Line 2160  function form_control(theForm)
Line 2161  function form_control(theForm)
   
   
                 if ($this->nav_down()) {                  if ($this->nav_down()) {
                         //display buttons at bottom of page - sparky  
                         echo '<hr>'."\n";                          echo '<hr>'."\n";
                         $this->display_list_table_buttons($total_recs);                          $this->display_list_table_buttons($total_recs);
                 }                  }
Line 2188  function form_control(theForm)
Line 2188  function form_control(theForm)
         function display_record() /* {{{ */          function display_record() /* {{{ */
         {          {
                 $this->create_javascripts();                  $this->create_javascripts();
   
                 if ($this->nav_up()) {  
                         //display buttons at top of page - sparky  
                         $this->display_record_buttons ();  
                         echo "  <hr />\n";  
                 }  
   
                 echo '<table width="100%" border="1" cellpadding="1" cellspacing="0" summary="'.$this->tb.'">'."\n";  
                 echo '<input type="hidden" name="rec" value="'.($this->copy_operation()?'':$this->rec).'">'."\n";                  echo '<input type="hidden" name="rec" value="'.($this->copy_operation()?'':$this->rec).'">'."\n";
                 echo '<input type="hidden" name="fm" value="'.$this->fm.'">'."\n";                  echo '<input type="hidden" name="fm" value="'.$this->fm.'">'."\n";
                 $this->write_origvars_html($this->get_sfn_cgi_vars());                  $this->write_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";
                 echo $this->get_qf_hidden_fields();                  echo $this->get_qf_hidden_fields();
                 echo '<input type="hidden" name="qfn" value="'.htmlspecialchars($this->qfn).'">'."\n";                  echo '<input type="hidden" name="qfn" value="'.htmlspecialchars($this->qfn).'">'."\n";
   
                 /*                  /*
                 $this->qfn = '';                  $this->qfn = '';
                 for ($k = 0; $k < $this->num_fds; $k++) {                  for ($k = 0; $k < $this->num_fds; $k++) {
Line 2234  function form_control(theForm)
Line 2228  function form_control(theForm)
                 }                  }
                 */                  */
   
                   if ($this->nav_up()) {
                           $this->display_record_buttons();
                           echo '<hr>'."\n";
                   }
                   echo '<table width="100%" border="1" cellpadding="1" cellspacing="0" summary="'.$this->tb.'">'."\n";
                 if ($this->add_operation()) {                  if ($this->add_operation()) {
                         $this->display_add_record();                          $this->display_add_record();
                 } else {                  } else {
Line 2241  function form_control(theForm)
Line 2240  function form_control(theForm)
                 }                  }
                 echo '</table>'."\n";                  echo '</table>'."\n";
                 if ($this->nav_down()) {                  if ($this->nav_down()) {
                         //display buttons at bottom of page - sparky                          echo '<hr>'."\n";
                         echo "  <hr />\n";  
                         $this->display_record_buttons();                          $this->display_record_buttons();
                 }                  }
                 echo '</form>'."\n";                  echo '</form>'."\n";

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

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