Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, April 20, 2024

Diff for phpMyEdit/phpMyEdit.class.php between version 1.150 and 1.151

version 1.150, 2004/11/10 17:01:33 version 1.151, 2004/11/20 02:24:31
Line 19 
Line 19 
  * http://platon.sk/projects/phpMyEdit/   * http://platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.149 2004/11/02 20:08:11 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.150 2004/11/10 17:01:33 nepto Exp $ */
   
 /*  This is a generic table editing program. The table and fields to be  /*  This is a generic table editing program. The table and fields to be
         edited are defined in the calling program.          edited are defined in the calling program.
Line 139  class phpMyEdit
Line 139  class phpMyEdit
         // Additional features          // Additional features
         var $labels;            // multilingual labels          var $labels;            // multilingual labels
         var $cgi;                       // CGI variable features array          var $cgi;                       // CGI variable features array
           var $js;                        // JS configuration array
           var $dhtml;                     // DHTML configuration array
         var $url;                       // URL array          var $url;                       // URL array
         var $message;           // informational message to print          var $message;           // informational message to print
         var $notify;            // change notification e-mail adresses          var $notify;            // change notification e-mail adresses
Line 608  class phpMyEdit
Line 610  class phpMyEdit
                         $l    = 'qf'.$k;                          $l    = 'qf'.$k;
                         $lc   = 'qf'.$k.'_comp';                          $lc   = 'qf'.$k.'_comp';
                         $li   = 'qf'.$k.'_id';                          $li   = 'qf'.$k.'_id';
                         $m    = $this->get_cgi_var($l);                          $m    = $this->get_sys_cgi_var($l);
                         $mc   = $this->get_cgi_var($lc);                          $mc   = $this->get_sys_cgi_var($lc);
                         $mi   = $this->get_cgi_var($li);                          $mi   = $this->get_sys_cgi_var($li);
                         if (! isset($m) && ! isset($mi)) {                          if (! isset($m) && ! isset($mi)) {
                                 continue;                                  continue;
                         }                          }
Line 720  class phpMyEdit
Line 722  class phpMyEdit
                                 // initial TAB styles                                  // initial TAB styles
                                 echo '<style type="text/css" media="screen">',"\n";                                  echo '<style type="text/css" media="screen">',"\n";
                                 for ($i = 0; $i < count($this->tabs); $i++) {                                  for ($i = 0; $i < count($this->tabs); $i++) {
                                         echo '  #phpMyEdit_tab',$i,' { display: ';                                          echo '  #'.$this->dhtml['prefix'].'tab',$i,' { display: ';
                                         echo ($i <= $def_selected ? 'block' : 'none') ,'; }',"\n";                                          echo ($i <= $def_selected ? 'block' : 'none') ,'; }',"\n";
                                 }                                  }
                                 echo '</style>',"\n";                                  echo '</style>',"\n";
Line 728  class phpMyEdit
Line 730  class phpMyEdit
                                 echo '<script type="text/javascript"><!--',"\n\n";                                  echo '<script type="text/javascript"><!--',"\n\n";
                                 $css_class_name1 = $this->getCSSclass('tab', $position);                                  $css_class_name1 = $this->getCSSclass('tab', $position);
                                 $css_class_name2 = $this->getCSSclass('tab-selected', $position);                                  $css_class_name2 = $this->getCSSclass('tab-selected', $position);
                                 echo 'var phpMyEdit_current_tab  = "phpMyEdit_tab',$def_selected,'";                                  echo 'var '.$this->js['prefix'].'current_tab  = "'.$this->dhtml['prefix'].'tab',$def_selected,'";
   
 function phpMyEdit_show_tab(tab_name)  function '.$this->js['prefix'].'show_tab(tab_name)
 {';  {';
                                 if ($this->nav_up()) {                                  if ($this->nav_up()) {
                                         echo '                                          echo '
         document.getElementById(phpMyEdit_current_tab+"_up_label").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'current_tab+"_up_label").className = "',$css_class_name1,'";
         document.getElementById(phpMyEdit_current_tab+"_up_link").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'current_tab+"_up_link").className = "',$css_class_name1,'";
         document.getElementById(tab_name+"_up_label").className = "',$css_class_name2,'";          document.getElementById(tab_name+"_up_label").className = "',$css_class_name2,'";
         document.getElementById(tab_name+"_up_link").className = "',$css_class_name2,'";';          document.getElementById(tab_name+"_up_link").className = "',$css_class_name2,'";';
                                 }                                  }
                                 if ($this->nav_down()) {                                  if ($this->nav_down()) {
                                         echo '                                          echo '
         document.getElementById(phpMyEdit_current_tab+"_down_label").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'current_tab+"_down_label").className = "',$css_class_name1,'";
         document.getElementById(phpMyEdit_current_tab+"_down_link").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'current_tab+"_down_link").className = "',$css_class_name1,'";
         document.getElementById(tab_name+"_down_label").className = "',$css_class_name2,'";          document.getElementById(tab_name+"_down_label").className = "',$css_class_name2,'";
         document.getElementById(tab_name+"_down_link").className = "',$css_class_name2,'";';          document.getElementById(tab_name+"_down_link").className = "',$css_class_name2,'";';
                                 }                                  }
                                 echo '                                  echo '
         document.getElementById(phpMyEdit_current_tab).style.display = "none";          document.getElementById('.$this->js['prefix'].'current_tab).style.display = "none";
         document.getElementById(tab_name).style.display = "block";          document.getElementById(tab_name).style.display = "block";
         phpMyEdit_current_tab = tab_name;          '.$this->js['prefix'].'current_tab = tab_name;
 }',"\n\n";  }',"\n\n";
                                 echo '// --></script>', "\n";                                  echo '// --></script>', "\n";
                         }                          }
Line 764  function phpMyEdit_show_tab(tab_name)
Line 766  function phpMyEdit_show_tab(tab_name)
                                                 $first_required = false;                                                  $first_required = false;
                                                 echo '<script type="text/javascript"><!--',"\n";                                                  echo '<script type="text/javascript"><!--',"\n";
                                                 echo '                                                  echo '
 function phpMyEdit_trim(str)  function '.$this->js['prefix'].'trim(str)
 {  {
         while (str.substring(0, 1) == " "          while (str.substring(0, 1) == " "
                         || str.substring(0, 1) == "\\n"                          || str.substring(0, 1) == "\\n"
Line 781  function phpMyEdit_trim(str)
Line 783  function phpMyEdit_trim(str)
         return str;          return str;
 }  }
   
 function phpMyEdit_form_control(theForm)  function '.$this->js['prefix'].'form_control(theForm)
 {',"\n";  {',"\n";
                                         }                                          }
                                         if ($this->col_has_values($k)) {                                          if ($this->col_has_values($k)) {
                                                 $condition = 'theForm.'.$this->fds[$k].'.selectedIndex == -1';                                                  $condition = 'theForm.'.$this->cgi['prefix']['data'].$this->fds[$k].'.selectedIndex == -1';
                                                 $multiple  = $this->col_has_multiple_select($k);                                                  $multiple  = $this->col_has_multiple_select($k);
                                         } else {                                          } else {
                                                 $condition = '';                                                  $condition = '';
                                                 $multiple  = false;                                                  $multiple  = false;
                                                 if ($this->fdd[$k]['js']['required']) {                                                  if ($this->fdd[$k]['js']['required']) {
                                                         $condition = 'phpMyEdit_trim(theForm.'.$this->fds[$k].'.value) == ""';                                                          $condition = $this->js['prefix'].'trim(theForm.'.$this->cgi['prefix']['data'].$this->fds[$k].'.value) == ""';
                                                 }                                                  }
                                                 if (isset($this->fdd[$k]['js']['regexp'])) {                                                  if (isset($this->fdd[$k]['js']['regexp'])) {
                                                         $condition .= (strlen($condition) > 0 ? ' || ' : '');                                                          $condition .= (strlen($condition) > 0 ? ' || ' : '');
                                                         $condition .= sprintf('!(%s.test(phpMyEdit_trim(theForm.%s.value)))',                                                          $condition .= sprintf('!(%s.test('.$this->js['prefix'].'trim(theForm.%s.value)))',
                                                                         $this->fdd[$k]['js']['regexp'], $this->fds[$k]);                                                                          $this->fdd[$k]['js']['regexp'], $this->cgi['prefix']['data'].$this->fds[$k]);
                                                 }                                                  }
                                         }                                          }
   
Line 810  function phpMyEdit_form_control(theForm)
Line 812  function phpMyEdit_form_control(theForm)
                                                 echo '                                                  echo '
         multiple_select = null;          multiple_select = null;
         for (i = 0; i < theForm.length; i++) {          for (i = 0; i < theForm.length; i++) {
                 if (theForm.elements[i].name == "',$this->fds[$k],'[]") {                  if (theForm.elements[i].name == "',$this->cgi['prefix']['data'].$this->fds[$k],'[]") {
                         multiple_select = theForm.elements[i];                          multiple_select = theForm.elements[i];
                         break;                          break;
                 }                  }
Line 830  function phpMyEdit_form_control(theForm)
Line 832  function phpMyEdit_form_control(theForm)
                                         echo '");';                                          echo '");';
                                         if ($this->tabs_enabled() && $field_to_tab[$k] >= $def_selected) {                                          if ($this->tabs_enabled() && $field_to_tab[$k] >= $def_selected) {
                                                 echo '                                                  echo '
                 phpMyEdit_show_tab("phpMyEdit_tab',$field_to_tab[$k],'");';                  '.$this->js['prefix'].'show_tab("'.$this->dhtml['prefix'].'tab',$field_to_tab[$k],'");';
                                         }                                          }
                                         echo '                                          echo '
                 theForm.',$this->fds[$k],'.focus();                  theForm.',$this->cgi['prefix']['data'].$this->fds[$k],'.focus();
                 return false;                  return false;
         }',"\n";          }',"\n";
                                 }                                  }
Line 849  function phpMyEdit_form_control(theForm)
Line 851  function phpMyEdit_form_control(theForm)
                 if ($this->filter_operation()) {                  if ($this->filter_operation()) {
                                 echo '<script type="text/javascript"><!--',"\n";                                  echo '<script type="text/javascript"><!--',"\n";
                                 echo '                                  echo '
 function phpMyEdit_filter_handler(theForm, theEvent)  function '.$this->js['prefix'].'filter_handler(theForm, theEvent)
 {  {
         var pressed_key = null;          var pressed_key = null;
         if (theEvent.which) {          if (theEvent.which) {
Line 868  function phpMyEdit_filter_handler(theFor
Line 870  function phpMyEdit_filter_handler(theFor
   
                 if ($this->display['form']) {                  if ($this->display['form']) {
                         echo '<form class="',$this->getCSSclass('form'),'" method="POST"';                          echo '<form class="',$this->getCSSclass('form'),'" method="POST"';
                         echo ' action="',$page_name,'" name="phpMyEdit_form">',"\n";                          echo ' action="',$page_name,'" name="'.$this->cgi['prefix']['sys'].'form">',"\n";
                 }                  }
                 return true;                  return true;
         } /* }}} */          } /* }}} */
Line 890  function phpMyEdit_filter_handler(theFor
Line 892  function phpMyEdit_filter_handler(theFor
                 $def_selected = ($this->tabs[0] == 'PMEtab0') ? 1 : 0;                  $def_selected = ($this->tabs[0] == 'PMEtab0') ? 1 : 0;
                 for ($i = $def_selected; $i < count($this->tabs); $i++) {                  for ($i = $def_selected; $i < count($this->tabs); $i++) {
                         $css_class_name = $this->getCSSclass($i != $def_selected ? 'tab' : 'tab-selected', $position);                          $css_class_name = $this->getCSSclass($i != $def_selected ? 'tab' : 'tab-selected', $position);
                         echo '<td class="',$css_class_name,'" id="phpMyEdit_tab',$i,'_',$position,'_label">';                          echo '<td class="',$css_class_name,'" id="'.$this->dhtml['prefix'].'tab',$i,'_',$position,'_label">';
                         echo '<a class="',$css_class_name,'" id="phpMyEdit_tab',$i,'_',$position,'_link';                          echo '<a class="',$css_class_name,'" id="'.$this->dhtml['prefix'].'tab',$i,'_',$position,'_link';
                         echo '" href="javascript:phpMyEdit_show_tab(\'phpMyEdit_tab',$i,'\')">';                          echo '" href="javascript:'.$this->js['prefix'].'show_tab(\''.$this->dhtml['prefix'].'tab',$i,'\')">';
                         echo $this->tabs[$i],'</a></td>',"\n";                          echo $this->tabs[$i],'</a></td>',"\n";
                 }                  }
                 echo '<td class="',$this->getCSSclass('tab-end', $position),'">&nbsp;</td>',"\n";                  echo '<td class="',$this->getCSSclass('tab-end', $position),'">&nbsp;</td>',"\n";
Line 911  function phpMyEdit_filter_handler(theFor
Line 913  function phpMyEdit_filter_handler(theFor
                                 $tab++;                                  $tab++;
                                 echo '</table>',"\n";                                  echo '</table>',"\n";
                                 echo '</div>',"\n";                                  echo '</div>',"\n";
                                 echo '<div id="phpMyEdit_tab',$tab,'">',"\n";                                  echo '<div id="'.$this->dhtml['prefix'].'tab',$tab,'">',"\n";
                                 echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";                                  echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";
                         }                          }
                         if (! $this->displayed[$k]) {                          if (! $this->displayed[$k]) {
                                 continue;                                  continue;
                         }                          }
                         if ($this->hidden($k)) {                          if ($this->hidden($k)) {
                                 echo $this->htmlHidden($this->fds[$k], $row["qf$k"]);                                  echo $this->htmlHiddenData($this->fds[$k], $row["qf$k"]);
                                 continue;                                  continue;
                         }                          }
                         $css_postfix    = @$this->fdd[$k]['css']['postfix'];                          $css_postfix    = @$this->fdd[$k]['css']['postfix'];
                         $css_class_name = $this->getCSSclass('input', null, 'next', $css_postfix);                          $css_class_name = $this->getCSSclass('input', null, 'next', $css_postfix);
                         echo '<tr class="',$this->getCSSclass('row', null, true, $css_postfix),'">',"\n";                          echo '<tr class="',$this->getCSSclass('row', null, true, $css_postfix),'">',"\n";
                         echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">',$this->fdd[$k]['name'],'</td>',"\n";                          echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">';
                           echo $this->fdd[$k]['name'],'</td>',"\n";
                         echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"';                          echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"';
                         echo $this->getColAttributes($k),">\n";                          echo $this->getColAttributes($k),">\n";
                         if ($this->col_has_values($k)) {                          if ($this->col_has_values($k)) {
Line 934  function phpMyEdit_filter_handler(theFor
Line 937  function phpMyEdit_filter_handler(theFor
                                 $readonly   = $this->readonly($k);                                  $readonly   = $this->readonly($k);
                                 $strip_tags = true;                                  $strip_tags = true;
                                 $escape     = true;                                  $escape     = true;
                                 echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, $selected,                                  echo $this->htmlSelect($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name,
                                                 $multiple, $readonly, $strip_tags, $escape);                                                  $vals, $selected, $multiple, $readonly, $strip_tags, $escape);
                         } elseif (isset ($this->fdd[$k]['textarea'])) {                          } elseif (isset ($this->fdd[$k]['textarea'])) {
                                 echo '<textarea class="',$css_class_name,'" name="',$this->fds[$k],'"';                                  echo '<textarea class="',$css_class_name,'" name="',$this->cgi['prefix']['data'].$this->fds[$k],'"';
                                 echo ($this->readonly($k) ? ' disabled' : '');                                  echo ($this->readonly($k) ? ' disabled' : '');
                                 if (intval($this->fdd[$k]['textarea']['rows']) > 0) {                                  if (intval($this->fdd[$k]['textarea']['rows']) > 0) {
                                         echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"';                                          echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"';
Line 959  function phpMyEdit_filter_handler(theFor
Line 962  function phpMyEdit_filter_handler(theFor
                                 $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="',$css_class_name,'" type="text" ';                                  echo '<input class="',$css_class_name,'" type="text" ';
                                 echo ($this->readonly($k) ? 'disabled ' : ''),' name="',$this->fds[$k],'"';                                  echo ($this->readonly($k) ? 'disabled ' : '');
                                   echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'"';
                                 echo $size_ml_props,' value="';                                  echo $size_ml_props,' value="';
                                 echo htmlspecialchars($this->fdd[$k]['default']),'">';                                  echo htmlspecialchars($this->fdd[$k]['default']),'">';
                         }                          }
Line 994  function phpMyEdit_filter_handler(theFor
Line 998  function phpMyEdit_filter_handler(theFor
                                 $tab++;                                  $tab++;
                                 echo '</table>',"\n";                                  echo '</table>',"\n";
                                 echo '</div>',"\n";                                  echo '</div>',"\n";
                                 echo '<div id="phpMyEdit_tab',$tab,'">',"\n";                                  echo '<div id="'.$this->dhtml['prefix'].'tab',$tab,'">',"\n";
                                 echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";                                  echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";
                         }                          }
                         if (! $this->displayed[$k]) {                          if (! $this->displayed[$k]) {
Line 1003  function phpMyEdit_filter_handler(theFor
Line 1007  function phpMyEdit_filter_handler(theFor
                         if ($this->copy_operation() || $this->change_operation()) {                          if ($this->copy_operation() || $this->change_operation()) {
                                 if ($this->hidden($k)) {                                  if ($this->hidden($k)) {
                                         if ($k != $this->key_num) {                                          if ($k != $this->key_num) {
                                                 echo $this->htmlHidden($this->fds[$k], $row["qf$k"]);                                                  echo $this->htmlHiddenData($this->fds[$k], $row["qf$k"]);
                                         }                                          }
                                         continue;                                          continue;
                                 }                                  }
                                 $css_postfix = @$this->fdd[$k]['css']['postfix'];                                  $css_postfix = @$this->fdd[$k]['css']['postfix'];
                                 echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n";                                  echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n";
                                 echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">',$this->fdd[$k]['name'],'</td>',"\n";                                  echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">';
                                   echo $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 for readonly timestamps, dates and URLs.                                     1. Display plain text for readonly timestamps, dates and URLs.
                                    2. Display disabled input field                                     2. Display disabled input field
Line 1030  function phpMyEdit_filter_handler(theFor
Line 1035  function phpMyEdit_filter_handler(theFor
                         } elseif ($this->delete_operation() || $this->view_operation()) {                          } elseif ($this->delete_operation() || $this->view_operation()) {
                                 $css_postfix = @$this->fdd[$k]['css']['postfix'];                                  $css_postfix = @$this->fdd[$k]['css']['postfix'];
                                 echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n";                                  echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n";
                                 echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">',$this->fdd[$k]['name'],'</td>',"\n";                                  echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">';
                                   echo $this->fdd[$k]['name'],'</td>',"\n";
                                 if ($this->password($k)) {                                  if ($this->password($k)) {
                                         echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"';                                          echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"';
                                         echo $this->getColAttributes($k),'>',$this->labels['hidden'],'</td>',"\n";                                          echo $this->getColAttributes($k),'>',$this->labels['hidden'],'</td>',"\n";
Line 1059  function phpMyEdit_filter_handler(theFor
Line 1065  function phpMyEdit_filter_handler(theFor
                         $readonly   = $this->readonly($k);                          $readonly   = $this->readonly($k);
                         $strip_tags = true;                          $strip_tags = true;
                         $escape     = true;                          $escape     = true;
                         echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, $row["qf$k"],                          echo $this->htmlSelect($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name,
                                         $multiple, $readonly, $strip_tags, $escape);                                          $vals, $row["qf$k"], $multiple, $readonly, $strip_tags, $escape);
                 } elseif (isset($this->fdd[$k]['textarea'])) {                  } elseif (isset($this->fdd[$k]['textarea'])) {
                         echo '<textarea class="',$css_class_name,'" name="',$this->fds[$k],'"';                          echo '<textarea class="',$css_class_name,'" name="',$this->cgi['prefix']['data'].$this->fds[$k],'"';
                         echo ($this->readonly($k) ? ' disabled' : '');                          echo ($this->readonly($k) ? ' disabled' : '');
                         if (intval($this->fdd[$k]['textarea']['rows']) > 0) {                          if (intval($this->fdd[$k]['textarea']['rows']) > 0) {
                                 echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"';                                  echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"';
Line 1083  function phpMyEdit_filter_handler(theFor
Line 1089  function phpMyEdit_filter_handler(theFor
                         $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="',$css_class_name,'" type="text" ';                          echo '<input class="',$css_class_name,'" type="text" ';
                         echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="';                          echo ($this->readonly($k) ? 'disabled ' : '');
                           echo 'name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="';
                         echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n";                          echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n";
                 }                  }
                 echo '</td>',"\n";                  echo '</td>',"\n";
Line 1100  function phpMyEdit_filter_handler(theFor
Line 1107  function phpMyEdit_filter_handler(theFor
                 $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="',$this->getCSSclass('value', null, true, $css_postfix),'" type="password" ';                  echo '<input class="',$this->getCSSclass('value', null, true, $css_postfix),'" type="password" ';
                 echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="';                  echo ($this->readonly($k) ? 'disabled ' : '');
                   echo 'name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="';
                 echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n";                  echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n";
                 echo '</td>',"\n";                  echo '</td>',"\n";
         } /* }}} */          } /* }}} */
Line 1183  function phpMyEdit_filter_handler(theFor
Line 1191  function phpMyEdit_filter_handler(theFor
                 $ret  = '';                  $ret  = '';
                 $name = $this->fds[$k];                  $name = $this->fds[$k];
                 $page = $this->page_name;                  $page = $this->page_name;
                 $url  = 'rec='.$key.'&fm='.$this->fm.'&fl='.$this->fl;                  $url  = $this->cgi['prefix']['sys'].'rec'.'='.$key.'&'.$this->cgi['prefix']['sys'].'fm'
                 $url .= '&qfn='.rawurlencode($this->qfn).$this->qfn;                          .'='.$this->fm.'&'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl;
                   $url .= '&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn).$this->qfn;
                 $url .= '&'.$this->get_sfn_cgi_vars().$this->cgi['persist'];                  $url .= '&'.$this->get_sfn_cgi_vars().$this->cgi['persist'];
                 $ar   = array(                  $ar   = array(
                                 'key'   => $key,                                  'key'   => $key,
Line 1316  function phpMyEdit_filter_handler(theFor
Line 1325  function phpMyEdit_filter_handler(theFor
                 // 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
                 $markdisabled = $disabled ? ' disabled' : '';                  $markdisabled = $disabled ? ' disabled' : '';
                 $ret = '<input'.$markdisabled.' type="submit" class="'.$css_class_name                  $ret = '<input'.$markdisabled.' type="submit" class="'.$css_class_name
                         .'" name="'.ltrim($markdisabled).$name                          .'" name="'.$this->cgi['prefix']['sys'].ltrim($markdisabled).$name
                         .'" value="'.(isset($this->labels[$label]) ? $this->labels[$label] : $label);                          .'" value="'.(isset($this->labels[$label]) ? $this->labels[$label] : $label);
                 if ($js_validation) {                  if ($js_validation) {
                         $ret .= '" onClick="return phpMyEdit_form_control(this.form);';                          $ret .= '" onClick="return '.$this->js['prefix'].'form_control(this.form);';
                 }                  }
                 $ret .= '">';                  $ret .= '" />';
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
   
Line 1331  function phpMyEdit_filter_handler(theFor
Line 1340  function phpMyEdit_filter_handler(theFor
          * @param       name    element name           * @param       name    element name
          * @param       value   value           * @param       value   value
          */           */
   
           function htmlHiddenSys($name, $value) /* {{{ */
           {
                   return $this->htmlHidden($this->cgi['prefix']['sys'].$name, $value);
           } /* }}} */
   
           function htmlHiddenData($name, $value) /* {{{ */
           {
                   return $this->htmlHidden($this->cgi['prefix']['data'].$name, $value);
           } /* }}} */
   
         function htmlHidden($name, $value) /* {{{ */          function htmlHidden($name, $value) /* {{{ */
         {          {
                 return '<input type="hidden" name="'.htmlspecialchars($name)                  return '<input type="hidden" name="'.htmlspecialchars($name)
                         .'" value="'.htmlspecialchars($value).'">'."\n";                          .'" value="'.htmlspecialchars($value).'"/>'."\n";
         } /* }}} */          } /* }}} */
   
         /**          /**
Line 1414  function phpMyEdit_filter_handler(theFor
Line 1434  function phpMyEdit_filter_handler(theFor
                 }                  }
                 $key = rawurldecode($key);                  $key = rawurldecode($key);
                 $val = rawurldecode($val);                  $val = rawurldecode($val);
                 $ret .= '<input type="hidden" name="';                  $ret .= $this->htmlHidden($key, $val);
                 $ret .= htmlspecialchars($key).'"';  
                 $ret .= ' value="'.htmlspecialchars($val).'"';  
                 $ret .= " />\n";  
             }              }
         } else if (! strncmp('GET', $method, 3)) {          } else if (! strncmp('GET', $method, 3)) {
             if (! is_array($origvars)) {              if (! is_array($origvars)) {
Line 1454  function phpMyEdit_filter_handler(theFor
Line 1471  function phpMyEdit_filter_handler(theFor
                 $i   = 0;                  $i   = 0;
                 foreach ($alternative_sfn as $val) {                  foreach ($alternative_sfn as $val) {
                         $ret != '' && $ret .= '&';                          $ret != '' && $ret .= '&';
                         $ret .= "sfn[$i]=".rawurlencode($val);                          $ret .= rawurlencode($this->cgi['prefix']['sys'].'sfn')."[$i]=".rawurlencode($val);
                         $i++;                          $i++;
                 }                  }
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
   
           function get_sys_cgi_var($name, $default_value = null) /* {{{ */
           {
                   return $this->get_cgi_var($this->cgi['prefix']['sys'].$name, $default_value);
           } /* }}} */
   
           function get_data_cgi_var($name, $default_value = null) /* {{{ */
           {
                   return $this->get_cgi_var($this->cgi['prefix']['data'].$name, $default_value);
           } /* }}} */
   
         function get_cgi_var($name, $default_value = null) /* {{{ */          function get_cgi_var($name, $default_value = null) /* {{{ */
         {          {
                 if (isset($this) && isset($this->cgi['overwrite'][$name])) {                  if (isset($this) && isset($this->cgi['overwrite'][$name])) {
Line 1652  function phpMyEdit_filter_handler(theFor
Line 1679  function phpMyEdit_filter_handler(theFor
                         echo $this->htmlSubmit('navop', 'Go to', $this->getCSSclass('goto', $position), false,                          echo $this->htmlSubmit('navop', 'Go to', $this->getCSSclass('goto', $position), false,
                                 ($listall || ($disablednext && $disabledprev)));                                  ($listall || ($disablednext && $disabledprev)));
                         echo '<select',$disabledgoto,' class="',$this->getCSSclass('goto', $position);                          echo '<select',$disabledgoto,' class="',$this->getCSSclass('goto', $position);
                         echo '" name="',ltrim($disabledgoto),'navfm',$position,'" onChange="return this.form.submit();">',"\n";                          echo '" name="',$this->cgi['prefix']['sys'].ltrim($disabledgoto).'navfm',$position,'" onChange="return this.form.submit();">',"\n";
                         for ($i = 0; $i < $total_pages; $i++) {                          for ($i = 0; $i < $total_pages; $i++) {
                                 echo '<option',($this->fm == $this->inc * $i) ? ' selected' : '';                                  echo '<option',($this->fm == $this->inc * $i) ? ' selected' : '';
                                 echo ' value="',$this->inc * $i,'">',$i + 1,'</option>',"\n";                                  echo ' value="',$this->inc * $i,'">',$i + 1,'</option>',"\n";
Line 1757  function phpMyEdit_filter_handler(theFor
Line 1784  function phpMyEdit_filter_handler(theFor
                  */                   */
                 $this->form_begin();                  $this->form_begin();
                 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 $this->htmlHiddenSys('fl', $this->fl);
                 // Display buttons at top and/or bottom of page.                  // Display buttons at top and/or bottom of page.
                 // Setup query to get num_rows. (sparky)                  // Setup query to get num_rows. (sparky)
                 $total_recs  = 0;                  $total_recs  = 0;
Line 1782  function phpMyEdit_filter_handler(theFor
Line 1809  function phpMyEdit_filter_handler(theFor
                 if (! $this->filter_operation()) {                  if (! $this->filter_operation()) {
                         echo $this->get_origvars_html($this->qfn);                          echo $this->get_origvars_html($this->qfn);
                 }                  }
                 echo '<input type="hidden" name="qfn" value="',htmlspecialchars($this->qfn),'">',"\n";                  echo $this->htmlHiddenSys('qfn', $this->qfn);
                 echo '<input type="hidden" name="fm" value="',htmlspecialchars($this->fm),'">',"\n";                  echo $this->htmlHiddenSys('fm', $this->fm);
                 echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";                  echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";
                 echo '<tr class="',$this->getCSSclass('header'),'">',"\n";                  echo '<tr class="',$this->getCSSclass('header'),'">',"\n";
                 /*                  /*
Line 1803  function phpMyEdit_filter_handler(theFor
Line 1830  function phpMyEdit_filter_handler(theFor
                         echo '<th class="',$this->getCSSclass('header'),'" colspan="',$sys_cols,'">';                          echo '<th class="',$this->getCSSclass('header'),'" colspan="',$sys_cols,'">';
                         if ($this->filter_enabled()) {                          if ($this->filter_enabled()) {
                                 if ($this->filter_operation()) {                                  if ($this->filter_operation()) {
                                         echo '<input class="',$this->getCSSclass('hide'),'" type="submit" name="sw" value="';                                          echo $this->htmlSubmit('sw', 'Hide', $this->getCSSclass('hide'), false);
                                         echo $this->labels['Hide'],'">';                                          echo $this->htmlSubmit('sw', 'Clear', $this->getCSSclass('clear'), false);
                                         echo '<input class="',$this->getCSSclass('clear'),'" type="submit" name="sw" value="';  
                                         echo $this->labels['Clear'],'">';  
                                 } else {                                  } else {
                                         echo '<input class="',$this->getCSSclass('search'),'" type="submit" name="sw" value="';                                          echo $this->htmlSubmit('sw', 'Search', $this->getCSSclass('search'), false);
                                         echo $this->labels['Search'],'">';  
                                 }                                  }
                         } else {                          } else {
                                 echo '&nbsp;';                                  echo '&nbsp;';
Line 1832  function phpMyEdit_filter_handler(theFor
Line 1856  function phpMyEdit_filter_handler(theFor
                                 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 class="',$css_class_name,'">';                                  echo '<th class="',$css_class_name,'">';
                                 echo '<a class="',$css_class_name,'" href="';                                  echo '<a class="',$css_class_name,'" href="';
                                 echo htmlspecialchars($this->page_name.'?fm=0&fl='.$this->fl                                  echo htmlspecialchars($this->page_name.'?'.$this->cgi['prefix']['sys'].'fm'.'=0'
                                                 .'&qfn='.rawurlencode($this->qfn).$this->qfn                                                  .'&'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl
                                                   .'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn).$this->qfn
                                                 .'&'.$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist']);                                                  .'&'.$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist']);
                                 echo '">',$fdn,'</a></th>',"\n";                                  echo '">',$fdn,'</a></th>',"\n";
                         }                          }
Line 1933  function phpMyEdit_filter_handler(theFor
Line 1958  function phpMyEdit_filter_handler(theFor
                                 $css_class_name = $this->getCSSclass('filter');                                  $css_class_name = $this->getCSSclass('filter');
                                 echo '<tr class="',$css_class_name,'">',"\n";                                  echo '<tr class="',$css_class_name,'">',"\n";
                                 echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';                                  echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';
                                 echo '<input class="',$this->getCSSclass('query'),'" type="submit" name="filter" value="';                                  echo $this->htmlSubmit('filter', 'Query', $this->getCSSclass('query'), false);
                                 echo $this->labels['Query'],'"></td>',"\n";                                  echo '</td>', "\n";
                                 for ($k = 0; $k < $this->num_fds; $k++) {                                  for ($k = 0; $k < $this->num_fds; $k++) {
                                         if (! $this->displayed[$k]) {                                          if (! $this->displayed[$k]) {
                                                 continue;                                                  continue;
Line 1952  function phpMyEdit_filter_handler(theFor
Line 1977  function phpMyEdit_filter_handler(theFor
                                                 $mc = null;                                                  $mc = null;
                                                 $mi = null;                                                  $mi = null;
                                         } else {                                          } else {
                                                 $m  = $this->get_cgi_var($l);                                                  $m  = $this->get_sys_cgi_var($l);
                                                 $mc = $this->get_cgi_var($lc);                                                  $mc = $this->get_sys_cgi_var($lc);
                                                 $mi = $this->get_cgi_var($li);                                                  $mi = $this->get_sys_cgi_var($li);
                                         }                                          }
                                         echo '<td class="',$css_class_name,'">';                                          echo '<td class="',$css_class_name,'">';
                                         if ($this->password($k)) {                                          if ($this->password($k)) {
Line 1970  function phpMyEdit_filter_handler(theFor
Line 1995  function phpMyEdit_filter_handler(theFor
                                                 $readonly   = false;                                                  $readonly   = false;
                                                 $strip_tags = true;                                                  $strip_tags = true;
                                                 $escape     = true;                                                  $escape     = true;
                                                 echo $this->htmlSelect($l.'_id', $css_class_name, $vals,                                                  echo $this->htmlSelect($this->cgi['prefix']['sys'].$l.'_id', $css_class_name,
                                                                 $selected, $multiple, $readonly, $strip_tags, $escape);                                                                  $vals, $selected, $multiple, $readonly, $strip_tags, $escape);
                                         } elseif ($this->fdd[$fd]['select'] == 'N' || $this->fdd[$fd]['select'] == 'T') {                                          } elseif ($this->fdd[$fd]['select'] == 'N' || $this->fdd[$fd]['select'] == 'T') {
                                                 $size_ml_props = '';                                                  $size_ml_props = '';
                                                 $maxlen = intval($this->fdd[$k]['maxlen']);                                                  $maxlen = intval($this->fdd[$k]['maxlen']);
Line 1982  function phpMyEdit_filter_handler(theFor
Line 2007  function phpMyEdit_filter_handler(theFor
                                                 $maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"';                                                  $maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"';
                                                 if ($this->fdd[$fd]['select'] == 'N') {                                                  if ($this->fdd[$fd]['select'] == 'N') {
                                                         $mc = in_array($mc, $this->comp_ops) ? $mc : '=';                                                          $mc = in_array($mc, $this->comp_ops) ? $mc : '=';
                                                         echo $this->htmlSelect($l.'_comp', $css_class_name, $this->comp_ops, $mc);                                                          echo $this->htmlSelect($this->cgi['prefix']['sys'].$l.'_comp',
                                                                           $css_class_name, $this->comp_ops, $mc);
                                                 }                                                  }
                                                 echo '<input class="',$css_class_name,'" value="';                                                  echo '<input class="',$css_class_name,'" value="',htmlspecialchars(@$m);
                                                 echo htmlspecialchars(@$m),'" type="text" name="qf',$k,'"',$size_ml_props;                                                  echo '" type="text" name="'.$this->cgi['prefix']['sys'].'qf'.$k.'"',$size_ml_props;
                                                 echo ' onKeyPress="return phpMyEdit_filter_handler(this.form, event);">';                                                  echo ' onKeyPress="return '.$this->js['prefix'].'filter_handler(this.form, event);">';
                                         } else {                                          } else {
                                                 echo '&nbsp;';                                                  echo '&nbsp;';
                                         }                                          }
Line 2004  function phpMyEdit_filter_handler(theFor
Line 2030  function phpMyEdit_filter_handler(theFor
                         echo '<tr class="',$css_class_name,'">',"\n";                          echo '<tr class="',$css_class_name,'">',"\n";
                         echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';                          echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';
                         echo '<a class="',$css_class_name,'" href="';                          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')
                                         .'&qfn='.rawurlencode($this->qfn).$this->qfn.$this->cgi['persist']);                                          .'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl
                                           .'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm
                                           .'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn)
                                           .$this->qfn.$this->cgi['persist']);
                         echo '">',$this->labels['Clear'],'</a></td>',"\n";                          echo '">',$this->labels['Clear'],'</a></td>',"\n";
                         echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">';                          echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">';
                         echo $this->labels['Sorted By'],': ',join(', ', $sort_fields_w),'</td></tr>',"\n";                          echo $this->labels['Sorted By'],': ',join(', ', $sort_fields_w),'</td></tr>',"\n";
Line 2020  function phpMyEdit_filter_handler(theFor
Line 2049  function phpMyEdit_filter_handler(theFor
                         echo '<tr class="',$css_class_name,'">',"\n";                          echo '<tr class="',$css_class_name,'">',"\n";
                         echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';                          echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">';
                         echo '<a class="',$css_class_name,'" href="';                          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')
                                         .'&qfn='.rawurlencode($this->qfn).'&'.$this->get_sfn_cgi_vars().$this->cgi['persist']);                                          .'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl
                                           .'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm
                                           .'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn)
                                           .'&'.$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="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">';                          echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">';
                         echo $this->labels['Current Query'],': ',htmlspecialchars($text_query),'</td></tr>',"\n";                          echo $this->labels['Current Query'],': ',htmlspecialchars($text_query),'</td></tr>',"\n";
Line 2029  function phpMyEdit_filter_handler(theFor
Line 2061  function phpMyEdit_filter_handler(theFor
   
                 if ($this->nav_text_links() || $this->nav_graphic_links()) {                  if ($this->nav_text_links() || $this->nav_graphic_links()) {
                         $qstrparts = array();                          $qstrparts = array();
                         strlen($this->fl)             > 0 && $qstrparts[] = 'fl='.$this->fl;                          strlen($this->fl)             > 0 && $qstrparts[] = $this->cgi['prefix']['sys'].'fl'.'='.$this->fl;
                         strlen($this->fm)             > 0 && $qstrparts[] = 'fm='.$this->fm;                          strlen($this->fm)             > 0 && $qstrparts[] = $this->cgi['prefix']['sys'].'fm'.'='.$this->fm;
                         count($this->sfn)             > 0 && $qstrparts[] = $this->get_sfn_cgi_vars();                          count($this->sfn)             > 0 && $qstrparts[] = $this->get_sfn_cgi_vars();
                         strlen($this->cgi['persist']) > 0 && $qstrparts[] = $this->cgi['persist'];                          strlen($this->cgi['persist']) > 0 && $qstrparts[] = $this->cgi['persist'];
                         $qpview      = $qstrparts;                          $qpview      = $qstrparts;
                         $qpcopy      = $qstrparts;                          $qpcopy      = $qstrparts;
                         $qpchange    = $qstrparts;                          $qpchange    = $qstrparts;
                         $qpdelete    = $qstrparts;                          $qpdelete    = $qstrparts;
                         $qpview[]    = 'operation='.$this->cgi['prefix']['operation'].'View';                          $qp_prefix   = $this->cgi['prefix']['sys'].'operation'.'='.$this->cgi['prefix']['operation'];
                         $qpcopy[]    = 'operation='.$this->cgi['prefix']['operation'].'Copy';                          $qpview[]    = $qp_prefix.'View';
                         $qpchange[]  = 'operation='.$this->cgi['prefix']['operation'].'Change';                          $qpcopy[]    = $qp_prefix.'Copy';
                         $qpdelete[]  = 'operation='.$this->cgi['prefix']['operation'].'Delete';                          $qpchange[]  = $qp_prefix.'Change';
                           $qpdelete[]  = $qp_prefix.'Delete';
                         $qpviewStr   = htmlspecialchars($this->page_name.'?'.join('&',$qpview).$this->qfn);                          $qpviewStr   = htmlspecialchars($this->page_name.'?'.join('&',$qpview).$this->qfn);
                         $qpcopyStr   = htmlspecialchars($this->page_name.'?'.join('&',$qpcopy).$this->qfn);                          $qpcopyStr   = htmlspecialchars($this->page_name.'?'.join('&',$qpcopy).$this->qfn);
                         $qpchangeStr = htmlspecialchars($this->page_name.'?'.join('&',$qpchange).$this->qfn);                          $qpchangeStr = htmlspecialchars($this->page_name.'?'.join('&',$qpchange).$this->qfn);
Line 2056  function phpMyEdit_filter_handler(theFor
Line 2089  function phpMyEdit_filter_handler(theFor
                         echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n";                          echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n";
                         if ($sys_cols) { /* {{{ */                          if ($sys_cols) { /* {{{ */
                                 $key_rec     = $row['qf'.$this->key_num];                                  $key_rec     = $row['qf'.$this->key_num];
                                 $viewQuery   = $qpviewStr   . htmlspecialchars('&rec='.$key_rec);                                  $queryAppend = htmlspecialchars('&'.$this->cgi['prefix']['sys'].'rec'.'='.$key_rec);
                                 $copyQuery   = $qpcopyStr   . htmlspecialchars('&rec='.$key_rec);                                  $viewQuery   = $qpviewStr   . $queryAppend;
                                 $changeQuery = $qpchangeStr . htmlspecialchars('&rec='.$key_rec);                                  $copyQuery   = $qpcopyStr   . $queryAppend;
                                 $deleteQuery = $qpdeleteStr . htmlspecialchars('&rec='.$key_rec);                                  $changeQuery = $qpchangeStr . $queryAppend;
                                   $deleteQuery = $qpdeleteStr . $queryAppend;
                                 $viewTitle   = htmlspecialchars($this->labels['View']);                                  $viewTitle   = htmlspecialchars($this->labels['View']);
                                 $changeTitle = htmlspecialchars($this->labels['Change']);                                  $changeTitle = htmlspecialchars($this->labels['Change']);
                                 $copyTitle   = htmlspecialchars($this->labels['Copy']);                                  $copyTitle   = htmlspecialchars($this->labels['Copy']);
Line 2133  function phpMyEdit_filter_handler(theFor
Line 2167  function phpMyEdit_filter_handler(theFor
                                         }                                          }
                                         if ($this->nav_buttons()) {                                          if ($this->nav_buttons()) {
                                                 echo '<td class="',$css_class_name,'"><input class="',$css_class_name;                                                  echo '<td class="',$css_class_name,'"><input class="',$css_class_name;
                                                 echo '" type="radio" name="rec" value="',htmlspecialchars($key_rec),'"';                                                  echo '" type="radio" name="'.$this->cgi['prefix']['sys'].'rec';
                                                   echo '" value="',htmlspecialchars($key_rec),'"';
                                                 if ($first) {                                                  if ($first) {
                                                         echo ' checked';                                                          echo ' checked';
                                                         $first = false;                                                          $first = false;
Line 2194  function phpMyEdit_filter_handler(theFor
Line 2229  function phpMyEdit_filter_handler(theFor
                                 if (stristr($this->fdd[$fd]['options'],'L') or !isset($this->fdd[$fd]['options'])) {                                  if (stristr($this->fdd[$fd]['options'],'L') or !isset($this->fdd[$fd]['options'])) {
                                         echo '<td>';                                          echo '<td>';
                                         $aggr_var  = 'qf'.$k.'_aggr';                                          $aggr_var  = 'qf'.$k.'_aggr';
                                         $$aggr_var = $this->get_cgi_var($aggr_var);                                          $$aggr_var = $this->get_sys_cgi_var($aggr_var);
                                         if ($$aggr_var) {                                          if ($$aggr_var) {
                                                 echo $this->sql_aggrs[$$aggr_var],': ',$tot_row[$aggr_var];                                                  echo $this->sql_aggrs[$$aggr_var],': ',$tot_row[$aggr_var];
                                         } else {                                          } else {
Line 2247  function phpMyEdit_filter_handler(theFor
Line 2282  function phpMyEdit_filter_handler(theFor
                 }                  }
                 echo $this->get_origvars_html($this->get_sfn_cgi_vars());                  echo $this->get_origvars_html($this->get_sfn_cgi_vars());
                 echo $this->get_origvars_html($this->qfn);                  echo $this->get_origvars_html($this->qfn);
                 echo '<input type="hidden" name="qfn" value="',htmlspecialchars($this->qfn),'">',"\n";                  echo $this->htmlHiddenSys('qfn', $this->qfn);
                 echo '<input type="hidden" name="rec" value="',($this->copy_operation()?'':$this->rec),'">',"\n";                  echo $this->htmlHiddenSys('rec', $this->copy_operation() ? '' : $this->rec);
                 echo '<input type="hidden" name="fm" value="',$this->fm,'">',"\n";                  echo $this->htmlHiddenSys('fm', $this->fm);
                 echo '<input type="hidden" name="fl" value="',$this->fl,'">',"\n";                  echo $this->htmlHiddenSys('fl', $this->fl);
                 if ($this->nav_up()) {                  if ($this->nav_up()) {
                         $this->display_record_buttons('up');                          $this->display_record_buttons('up');
                         echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n";                          echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n";
Line 2259  function phpMyEdit_filter_handler(theFor
Line 2294  function phpMyEdit_filter_handler(theFor
                         }                          }
                 }                  }
                 if ($this->tabs_enabled()) {                  if ($this->tabs_enabled()) {
                         echo '<div id="phpMyEdit_tab0">',"\n";                          echo '<div id="'.$this->dhtml['prefix'].'tab0">',"\n";
                 }                  }
                 echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";                  echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n";
                 if ($this->add_operation()) {                  if ($this->add_operation()) {
Line 2296  function phpMyEdit_filter_handler(theFor
Line 2331  function phpMyEdit_filter_handler(theFor
                                 if ($this->readonly($k)) {                                  if ($this->readonly($k)) {
                                         $fn = (string) @$this->fdd[$k]['default'];                                          $fn = (string) @$this->fdd[$k]['default'];
                                 } else {                                  } else {
                                         $fn = $this->get_cgi_var($fd);                                          $fn = $this->get_data_cgi_var($fd);
                                 }                                  }
                                 if ($fd == $this->key) {                                  if ($fd == $this->key) {
                                         $key_col_val = $fn;                                          $key_col_val = $fn;
Line 2378  function phpMyEdit_filter_handler(theFor
Line 2413  function phpMyEdit_filter_handler(theFor
                 for ($k = 0; $k < $this->num_fds; $k++) {                  for ($k = 0; $k < $this->num_fds; $k++) {
                         if ($this->processed($k) && !$this->readonly($k)) {                          if ($this->processed($k) && !$this->readonly($k)) {
                                 $fd = $this->fds[$k];                                  $fd = $this->fds[$k];
                                 $fn = $this->get_cgi_var($fd);                                  $fn = $this->get_data_cgi_var($fd);
                                 $newvals[$this->fds[$k]] = is_array($fn) ? join(',',$fn) : $fn;                                  $newvals[$this->fds[$k]] = is_array($fn) ? join(',',$fn) : $fn;
                                 if ($this->col_has_sqlw($k)) {                                  if ($this->col_has_sqlw($k)) {
                                         $val      = $newvals[$this->fds[$k]];                                          $val      = $newvals[$this->fds[$k]];
Line 2957  function phpMyEdit_filter_handler(theFor
Line 2992  function phpMyEdit_filter_handler(theFor
                 !isset($this->css['position'])  && $this->css['position']  = false;                  !isset($this->css['position'])  && $this->css['position']  = false;
                 !isset($this->css['divider'])   && $this->css['divider']   = 2;                  !isset($this->css['divider'])   && $this->css['divider']   = 2;
                 $this->css['divider'] = intval(@$this->css['divider']);                  $this->css['divider'] = intval(@$this->css['divider']);
                   // JS overall configuration
                   $this->js = @$opts['js'];
                   !isset($this->js['prefix']) && $this->js['prefix'] = 'PME_js_';
                   // DHTML overall configuration
                   $this->dhtml = @$opts['dhtml'];
                   !isset($this->dhtml['prefix']) && $this->dhtml['prefix'] = 'PME_dhtml_';
                 // Navigation                  // Navigation
                 $this->navigation = @$opts['navigation'];                  $this->navigation = @$opts['navigation'];
                 if (! $this->nav_buttons() && ! $this->nav_text_links() && ! $this->nav_graphic_links()) {                  if (! $this->nav_buttons() && ! $this->nav_text_links() && ! $this->nav_graphic_links()) {
Line 2969  function phpMyEdit_filter_handler(theFor
Line 3010  function phpMyEdit_filter_handler(theFor
                 $this->labels = $this->make_language_labels(isset($opts['language'])                  $this->labels = $this->make_language_labels(isset($opts['language'])
                                 ? $opts['language'] : $this->get_server_var('HTTP_ACCEPT_LANGUAGE'));                                  ? $opts['language'] : $this->get_server_var('HTTP_ACCEPT_LANGUAGE'));
                 // CGI variables                  // CGI variables
                 $this->cgi['append']    = @$opts['cgi']['append'];                  $this->cgi = @$opts['cgi'];
                 $this->cgi['overwrite'] = @$opts['cgi']['overwrite'];                  $this->cgi['persist'] = '';
                 $this->cgi['persist']   = '';  
                 if (@is_array($opts['cgi']['persist'])) {                  if (@is_array($opts['cgi']['persist'])) {
                         foreach ($opts['cgi']['persist'] as $key => $val) {                          foreach ($opts['cgi']['persist'] as $key => $val) {
                                 $this->cgi['persist'] .= '&'.urlencode($key).'='.urlencode($val);                                  if (is_array($val)) {
                                           foreach($val as $key2 => $val2) {
                                                   $this->cgi['persist'] .= '&'.rawurlencode($key)
                                                           .'['.rawurlencode($key2).']='.rawurlencode($val2);
                                           }
                                   } else {
                                           $this->cgi['persist'] .= '&'.rawurlencode($key).'='.rawurlencode($val);
                                   }
                         }                          }
                 }                  }
                 $this->cgi['prefix'] = array('operation' => 'PME::op::');                  !isset($this->cgi['prefix']['operation']) && $this->cgi['prefix']['operation'] = 'PME_op_';
                 if (isset($opts['cgi']['prefix']['operation'])) {                  !isset($this->cgi['prefix']['sys'])       && $this->cgi['prefix']['sys']       = 'PME_sys_';
                         $this->cgi['prefix']['operation'] = $opts['cgi']['prefix']['operation'];                  !isset($this->cgi['prefix']['data'])      && $this->cgi['prefix']['data']      = 'PME_data_';
                 }  
                 // Sorting variables                  // Sorting variables
                 $this->sfn   = $this->get_cgi_var('sfn');                  $this->sfn   = $this->get_sys_cgi_var('sfn');
                 isset($this->sfn)             || $this->sfn          = array();                  isset($this->sfn)             || $this->sfn          = array();
                 is_array($this->sfn)          || $this->sfn          = array($this->sfn);                  is_array($this->sfn)          || $this->sfn          = array($this->sfn);
                 isset($opts['sort_field'])    || $opts['sort_field'] = array();                  isset($opts['sort_field'])    || $opts['sort_field'] = array();
                 is_array($opts['sort_field']) || $opts['sort_field'] = array($opts['sort_field']);                  is_array($opts['sort_field']) || $opts['sort_field'] = array($opts['sort_field']);
                 $this->sfn   = array_merge($this->sfn, $opts['sort_field']);                  $this->sfn   = array_merge($this->sfn, $opts['sort_field']);
                 // Form variables all around                  // Form variables all around
                 $this->fl   = intval($this->get_cgi_var('fl'));                  $this->fl    = intval($this->get_sys_cgi_var('fl'));
                 $this->fm   = intval($this->get_cgi_var('fm'));                  $this->fm    = intval($this->get_sys_cgi_var('fm'));
                 $this->qfn  = $this->get_cgi_var('qfn');                  $this->qfn   = $this->get_sys_cgi_var('qfn');
                 $this->sw   = $this->get_cgi_var('sw');                  $this->sw    = $this->get_sys_cgi_var('sw');
                 $this->rec  = $this->get_cgi_var('rec', '');                  $this->rec   = $this->get_sys_cgi_var('rec', '');
                 $this->navop = $this->get_cgi_var('navop');                  $this->navop = $this->get_sys_cgi_var('navop');
                 if (($this->navfm = $this->get_cgi_var('navfmup', $this->fm)) != $this->fm) {                  if (($this->navfm = $this->get_sys_cgi_var('navfmup', $this->fm)) != $this->fm) {
                         $this->navop = $this->labels['Go to'];                          $this->navop = $this->labels['Go to'];
                 } else if (($this->navfm = $this->get_cgi_var('navfmdown', $this->navfm)) != $this->fm) {                  } else if (($this->navfm = $this->get_sys_cgi_var('navfmdown', $this->navfm)) != $this->fm) {
                         $this->navop = $this->labels['Go to'];                          $this->navop = $this->labels['Go to'];
                 }                  }
                 $this->operation = $this->get_cgi_var('operation');                  $this->operation = $this->get_sys_cgi_var('operation');
                 $oper_prefix_len = strlen($this->cgi['prefix']['operation']);                  $oper_prefix_len = strlen($this->cgi['prefix']['operation']);
                 if (! strncmp($this->cgi['prefix']['operation'], $this->operation, $oper_prefix_len)) {                  if (! strncmp($this->cgi['prefix']['operation'], $this->operation, $oper_prefix_len)) {
                         $this->operation = $this->labels[substr($this->operation, $oper_prefix_len)];                          $this->operation = $this->labels[substr($this->operation, $oper_prefix_len)];
                 }                  }
                 $this->saveadd      = $this->get_cgi_var('saveadd');                  $this->saveadd      = $this->get_sys_cgi_var('saveadd');
                 $this->moreadd      = $this->get_cgi_var('moreadd');                  $this->moreadd      = $this->get_sys_cgi_var('moreadd');
                 $this->canceladd    = $this->get_cgi_var('canceladd');                  $this->canceladd    = $this->get_sys_cgi_var('canceladd');
                 $this->savechange   = $this->get_cgi_var('savechange');                  $this->savechange   = $this->get_sys_cgi_var('savechange');
                 $this->morechange   = $this->get_cgi_var('morechange');                  $this->morechange   = $this->get_sys_cgi_var('morechange');
                 $this->cancelchange = $this->get_cgi_var('cancelchange');                  $this->cancelchange = $this->get_sys_cgi_var('cancelchange');
                 $this->savecopy     = $this->get_cgi_var('savecopy');                  $this->savecopy     = $this->get_sys_cgi_var('savecopy');
                 $this->cancelcopy   = $this->get_cgi_var('cancelcopy');                  $this->cancelcopy   = $this->get_sys_cgi_var('cancelcopy');
                 $this->savedelete   = $this->get_cgi_var('savedelete');                  $this->savedelete   = $this->get_sys_cgi_var('savedelete');
                 $this->canceldelete = $this->get_cgi_var('canceldelete');                  $this->canceldelete = $this->get_sys_cgi_var('canceldelete');
                 $this->cancelview   = $this->get_cgi_var('cancelview');                  $this->cancelview   = $this->get_sys_cgi_var('cancelview');
                 // Filter setting                  // Filter setting
                 if (isset($this->sw)) {                  if (isset($this->sw)) {
                         $this->sw == $this->labels['Search'] && $this->fl = 1;                          $this->sw == $this->labels['Search'] && $this->fl = 1;

Legend:
Removed from v.1.150  
changed lines
  Added in v.1.151

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