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.152 and 1.153

version 1.152, 2004/11/20 02:33:05 version 1.153, 2004/11/23 15:57:50
Line 19 
Line 19 
  * http://platon.sk/projects/phpMyEdit/   * http://platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.151 2004/11/20 02:24:31 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.152 2004/11/20 02:33:05 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 119  class phpMyEdit
Line 119  class phpMyEdit
         var $fdd;               // field definitions          var $fdd;               // field definitions
         var $qfn;               // value of all filters used during the last pass          var $qfn;               // value of all filters used during the last pass
         var $sfn;               // sort field number (- = descending sort order)          var $sfn;               // sort field number (- = descending sort order)
           var $cur_tab;   // current selected tab
   
         // Operation          // Operation
         var $navop;             // navigation buttons/operations          var $navop;             // navigation buttons/operations
Line 706  class phpMyEdit
Line 707  class phpMyEdit
                 if ($this->add_operation() || $this->change_operation() || $this->copy_operation()                  if ($this->add_operation() || $this->change_operation() || $this->copy_operation()
                                 || $this->view_operation() || $this->delete_operation()) {                                  || $this->view_operation() || $this->delete_operation()) {
                         $field_to_tab = array();                          $field_to_tab = array();
                         for ($tab = $k = $def_selected = 0; $k < $this->num_fds; $k++) {                          for ($tab = $k = $this->cur_tab = 0; $k < $this->num_fds; $k++) {
                                 if (isset($this->fdd[$k]['tab'])) {                                  if (isset($this->fdd[$k]['tab'])) {
                                         if ($tab == 0 && $k > 0) {                                          if ($tab == 0 && $k > 0) {
                                                 $this->tabs[0] = 'PMEtab0';                                                  $this->tabs[0] = 'PMEtab0';
                                                 $def_selected = 1;                                                  $this->cur_tab = 1;
                                                 $tab++;                                                  $tab++;
                                         }                                          }
                                         $this->tabs[$tab] = @$this->fdd[$k]['tab'];                                          if (is_array($this->fdd[$k]['tab'])) {
                                                   $this->tabs[$tab] = @$this->fdd[$k]['tab']['name'];
                                                   $this->fdd[$k]['tab']['default'] && $this->cur_tab = $tab;
                                           } else {
                                                   $this->tabs[$tab] = @$this->fdd[$k]['tab'];
                                           }
                                         $tab++;                                          $tab++;
                                 }                                  }
                                 $field_to_tab[$k] = max(0, $tab - 1);                                  $field_to_tab[$k] = max(0, $tab - 1);
                         }                          }
                           if (preg_match('/^'.$this->dhtml['prefix'].'tab(\d+)$/', $this->get_sys_cgi_var('cur_tab'), $parts)) {
                                   $this->cur_tab = $parts[1];
                           }
                         if ($this->tabs_enabled()) {                          if ($this->tabs_enabled()) {
                                 // 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 '  #'.$this->dhtml['prefix'].'tab',$i,' { display: ';                                          echo '  #'.$this->dhtml['prefix'].'tab',$i,' { display: ';
                                         echo ($i <= $def_selected ? 'block' : 'none') ,'; }',"\n";                                          echo (($i == $this->cur_tab || $this->tabs[$i] == 'PMEtab0' ) ? 'block' : 'none') ,'; }',"\n";
                                 }                                  }
                                 echo '</style>',"\n";                                  echo '</style>',"\n";
                                 // TAB javascripts                                  // TAB javascripts
                                 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 '.$this->js['prefix'].'current_tab  = "'.$this->dhtml['prefix'].'tab',$def_selected,'";                                  echo 'var '.$this->js['prefix'].'cur_tab  = "'.$this->dhtml['prefix'].'tab',$this->cur_tab,'";
   
 function '.$this->js['prefix'].'show_tab(tab_name)  function '.$this->js['prefix'].'show_tab(tab_name)
 {';  {';
                                 if ($this->nav_up()) {                                  if ($this->nav_up()) {
                                         echo '                                          echo '
         document.getElementById('.$this->js['prefix'].'current_tab+"_up_label").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'cur_tab+"_up_label").className = "',$css_class_name1,'";
         document.getElementById('.$this->js['prefix'].'current_tab+"_up_link").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'cur_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('.$this->js['prefix'].'current_tab+"_down_label").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'cur_tab+"_down_label").className = "',$css_class_name1,'";
         document.getElementById('.$this->js['prefix'].'current_tab+"_down_link").className = "',$css_class_name1,'";          document.getElementById('.$this->js['prefix'].'cur_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('.$this->js['prefix'].'current_tab).style.display = "none";          document.getElementById('.$this->js['prefix'].'cur_tab).style.display = "none";
         document.getElementById(tab_name).style.display = "block";          document.getElementById(tab_name).style.display = "block";
         '.$this->js['prefix'].'current_tab = tab_name;          '.$this->js['prefix'].'cur_tab = tab_name;
           document.'.$this->cgi['prefix']['sys'].'form.'.$this->cgi['prefix']['sys'].'cur_tab.value = tab_name;
 }',"\n\n";  }',"\n\n";
                                 echo '// --></script>', "\n";                                  echo '// --></script>', "\n";
                         }                          }
Line 830  function '.$this->js['prefix'].'form_con
Line 840  function '.$this->js['prefix'].'form_con
                                                 echo $this->labels['Please enter'],' ',$this->fdd[$k]['name'],'.';                                                  echo $this->labels['Please enter'],' ',$this->fdd[$k]['name'],'.';
                                         }                                          }
                                         echo '");';                                          echo '");';
                                         if ($this->tabs_enabled() && $field_to_tab[$k] >= $def_selected) {                                          if ($this->tabs_enabled() && $field_to_tab[$k] >= $this->cur_tab) {
                                                 echo '                                                  echo '
                 '.$this->js['prefix'].'show_tab("'.$this->dhtml['prefix'].'tab',$field_to_tab[$k],'");';                  '.$this->js['prefix'].'show_tab("'.$this->dhtml['prefix'].'tab',$field_to_tab[$k],'");';
                                         }                                          }
Line 889  function '.$this->js['prefix'].'filter_h
Line 899  function '.$this->js['prefix'].'filter_h
                 }                  }
                 echo '<table class="',$this->getCSSclass('tab', $position),'">',"\n";                  echo '<table class="',$this->getCSSclass('tab', $position),'">',"\n";
                 echo '<tr class="',$this->getCSSclass('tab', $position),'">',"\n";                  echo '<tr class="',$this->getCSSclass('tab', $position),'">',"\n";
                 $def_selected = ($this->tabs[0] == 'PMEtab0') ? 1 : 0;                  for ($i = ($this->tabs[0] == 'PMEtab0' ? 1 : 0); $i < count($this->tabs); $i++) {
                 for ($i = $def_selected; $i < count($this->tabs); $i++) {                          $css_class_name = $this->getCSSclass($i != $this->cur_tab ? 'tab' : 'tab-selected', $position);
                         $css_class_name = $this->getCSSclass($i != $def_selected ? 'tab' : 'tab-selected', $position);  
                         echo '<td class="',$css_class_name,'" id="'.$this->dhtml['prefix'].'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="'.$this->dhtml['prefix'].'tab',$i,'_',$position,'_link';                          echo '<a class="',$css_class_name,'" id="'.$this->dhtml['prefix'].'tab',$i,'_',$position,'_link';
                         echo '" href="javascript:'.$this->js['prefix'].'show_tab(\''.$this->dhtml['prefix'].'tab',$i,'\')">';                          echo '" href="javascript:'.$this->js['prefix'].'show_tab(\''.$this->dhtml['prefix'].'tab',$i,'\')">';
Line 2282  function '.$this->js['prefix'].'filter_h
Line 2291  function '.$this->js['prefix'].'filter_h
                 }                  }
                 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 $this->htmlHiddenSys('cur_tab', $this->dhtml['prefix'].'tab'.$this->cur_tab);
                 echo $this->htmlHiddenSys('qfn', $this->qfn);                  echo $this->htmlHiddenSys('qfn', $this->qfn);
                 echo $this->htmlHiddenSys('rec', $this->copy_operation() ? '' : $this->rec);                  echo $this->htmlHiddenSys('rec', $this->copy_operation() ? '' : $this->rec);
                 echo $this->htmlHiddenSys('fm', $this->fm);                  echo $this->htmlHiddenSys('fm', $this->fm);

Legend:
Removed from v.1.152  
changed lines
  Added in v.1.153

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