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

Diff for phpMyEdit/phpMyEdit.class.php between version 1.133 and 1.134

version 1.133, 2004/04/14 17:30:08 version 1.134, 2004/04/14 20:11:58
Line 19 
Line 19 
  * http://platon.sk/projects/phpMyEdit/   * http://platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.132 2004/04/12 20:38:07 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.133 2004/04/14 17:30:08 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 123  class phpMyEdit
Line 123  class phpMyEdit
         var $operation; // operation to do: Add, Change, Delete          var $operation; // operation to do: Add, Change, Delete
         var $saveadd;          var $saveadd;
         var $moreadd;          var $moreadd;
         var $savechange;  
         var $savedelete;  
         var $canceladd;          var $canceladd;
         var $cancelview;          var $savechange;
           var $morechange;
         var $cancelchange;          var $cancelchange;
           var $savecopy;
           var $cancelcopy;
           var $savedelete;
         var $canceldelete;          var $canceldelete;
           var $cancelview;
   
         // Additional features          // Additional features
         var $labels;            // multilingual labels          var $labels;            // multilingual labels
Line 220  class phpMyEdit
Line 223  class phpMyEdit
         function add_canceled()    { return $this->canceladd    == $this->labels['Cancel']; }          function add_canceled()    { return $this->canceladd    == $this->labels['Cancel']; }
         function view_canceled()   { return $this->cancelview   == $this->labels['Cancel']; }          function view_canceled()   { return $this->cancelview   == $this->labels['Cancel']; }
         function change_canceled() { return $this->cancelchange == $this->labels['Cancel']; }          function change_canceled() { return $this->cancelchange == $this->labels['Cancel']; }
           function copy_canceled()   { return $this->cancelcopy   == $this->labels['Cancel']; }
         function delete_canceled() { return $this->canceldelete == $this->labels['Cancel']; }          function delete_canceled() { return $this->canceldelete == $this->labels['Cancel']; }
   
         function is_values2($k, $val = 'X') /* {{{ */          function is_values2($k, $val = 'X') /* {{{ */
Line 242  class phpMyEdit
Line 246  class phpMyEdit
                         ($this->moreadd    == $this->labels['More']  && stristr($options, 'A')) ||                          ($this->moreadd    == $this->labels['More']  && stristr($options, 'A')) ||
                         ($this->savechange == $this->labels['Save']  && stristr($options, 'C')) ||                          ($this->savechange == $this->labels['Save']  && stristr($options, 'C')) ||
                         ($this->morechange == $this->labels['Apply'] && stristr($options, 'C')) ||                          ($this->morechange == $this->labels['Apply'] && stristr($options, 'C')) ||
                         ($this->savechange == $this->labels['Save']  && stristr($options, 'P')) ||                          ($this->savecopy   == $this->labels['Save']  && stristr($options, 'P')) ||
                         ($this->savedelete == $this->labels['Save']  && stristr($options, 'D'));                          ($this->savedelete == $this->labels['Save']  && stristr($options, 'D'));
         } /* }}} */          } /* }}} */
   
Line 1579  function phpMyEdit_filter_handler(theFor
Line 1583  function phpMyEdit_filter_handler(theFor
                 echo 'savechange=',$this->savechange,'   ';                  echo 'savechange=',$this->savechange,'   ';
                 echo 'morechange=',$this->morechange,'   ';                  echo 'morechange=',$this->morechange,'   ';
                 echo 'cancelchange=',$this->cancelchange,'   ';                  echo 'cancelchange=',$this->cancelchange,'   ';
                   echo 'savecopy=',$this->savecopy,'   ';
                   echo 'cancelcopy=',$this->cancelcopy,'   ';
                 echo 'savedelete=',$this->savedelete,'   ';                  echo 'savedelete=',$this->savedelete,'   ';
                 echo 'canceldelete=',$this->canceldelete,'   ';                  echo 'canceldelete=',$this->canceldelete,'   ';
                 echo 'cancelview=',$this->cancelview,'   ';                  echo 'cancelview=',$this->cancelview,'   ';
Line 1670  function phpMyEdit_filter_handler(theFor
Line 1676  function phpMyEdit_filter_handler(theFor
                         echo $this->htmlSubmit('moreadd', 'More', $this->getCSSclass('more', $position), true), ' ';                          echo $this->htmlSubmit('moreadd', 'More', $this->getCSSclass('more', $position), true), ' ';
                         echo $this->htmlSubmit('canceladd', 'Cancel', $this->getCSSclass('cancel', $position), false);                          echo $this->htmlSubmit('canceladd', 'Cancel', $this->getCSSclass('cancel', $position), false);
                 } elseif ($this->copy_operation()) {                  } elseif ($this->copy_operation()) {
                         echo $this->htmlSubmit('saveadd', 'Save', $this->getCSSclass('save', $position), true), ' ';                          echo $this->htmlSubmit('savecopy', 'Save', $this->getCSSclass('save', $position), true), ' ';
                         echo $this->htmlSubmit('canceladd', 'Cancel', $this->getCSSclass('cancel', $position), false);                          echo $this->htmlSubmit('cancelcopy', 'Cancel', $this->getCSSclass('cancel', $position), false);
                 } elseif ($this->delete_operation()) {                  } elseif ($this->delete_operation()) {
                         echo $this->htmlSubmit('savedelete', 'Delete', $this->getCSSclass('save', $position), true), ' ';                          echo $this->htmlSubmit('savedelete', 'Delete', $this->getCSSclass('save', $position), true), ' ';
                         echo $this->htmlSubmit('canceldelete', 'Cancel', $this->getCSSclass('cancel', $position), false);                          echo $this->htmlSubmit('canceldelete', 'Cancel', $this->getCSSclass('cancel', $position), false);
Line 1695  function phpMyEdit_filter_handler(theFor
Line 1701  function phpMyEdit_filter_handler(theFor
         function list_table() /* {{{ */          function list_table() /* {{{ */
         {          {
                 // Cancel Triggers                  // Cancel Triggers
                 if ($this->add_canceled() && isset($this->triggers['insert']['cancel'])) {                  if (($this->add_canceled() || $this->copy_canceled()) && isset($this->triggers['insert']['cancel'])) {
                         include($this->triggers['insert']['cancel']);                          include($this->triggers['insert']['cancel']);
                 }                  }
                 if ($this->view_canceled() && isset($this->triggers['select']['cancel'])) {                  if ($this->view_canceled() && isset($this->triggers['select']['cancel'])) {
Line 2585  function phpMyEdit_filter_handler(theFor
Line 2591  function phpMyEdit_filter_handler(theFor
                 $this->page_type = 'L'; // list by default                  $this->page_type = 'L'; // list by default
                 $this->filter_operation() && $this->page_type = 'F';                  $this->filter_operation() && $this->page_type = 'F';
                 $this->view_operation()   && $this->page_type = 'V';                  $this->view_operation()   && $this->page_type = 'V';
                 $this->delete_operation() && $this->page_type = 'D';                  if ($this->add_operation()
                 $this->add_operation()    && $this->page_type = 'A';                                  || $this->saveadd == $this->labels['Save']
                 $this->change_operation() && $this->page_type = 'C';                                  || $this->moreadd == $this->labels['More']) {
                 $this->copy_operation()   && $this->page_type = 'P';                          $this->page_type = 'A';
                   }
                   if ($this->change_operation()
                                   || $this->savechange == $this->labels['Save']
                                   || $this->morechange == $this->labels['Apply']) {
                           $this->page_type = 'C';
                   }
                   if ($this->copy_operation() || $this->savecopy == $this->labels['Save']) {
                           $this->page_type = 'P';
                   }
                   if ($this->delete_operation() || $this->savedelete == $this->labels['Delete']) {
                           $this->page_type = 'D';
                   }
                 // Restore backups (if exists)                  // Restore backups (if exists)
                 foreach (array_keys($this->fdd) as $column) {                  foreach (array_keys($this->fdd) as $column) {
                         foreach (array_keys($this->fdd[$column]) as $col_option) {                          foreach (array_keys($this->fdd[$column]) as $col_option) {
Line 2787  function phpMyEdit_filter_handler(theFor
Line 2805  function phpMyEdit_filter_handler(theFor
                  * a save button during Pass 2                   * a save button during Pass 2
                  * ======================================================================                   * ======================================================================
                  */                   */
                 if ($this->saveadd == $this->labels['Save']) {                  if ($this->saveadd == $this->labels['Save'] || $this->savecopy == $this->labels['Save']) {
                         $this->add_enabled() && $this->do_add_record();                          $this->add_enabled() && $this->do_add_record();
                           unset($this->saveadd);
                           unset($this->savecopy);
                           $this->recreate_fdd();
                 }                  }
                 elseif ($this->moreadd == $this->labels['More']) {                  elseif ($this->moreadd == $this->labels['More']) {
                         $this->add_enabled() && $this->do_add_record();                          $this->add_enabled() && $this->do_add_record();
Line 2799  function phpMyEdit_filter_handler(theFor
Line 2820  function phpMyEdit_filter_handler(theFor
                 }                  }
                 elseif ($this->savechange == $this->labels['Save']) {                  elseif ($this->savechange == $this->labels['Save']) {
                         $this->change_enabled() && $this->do_change_record();                          $this->change_enabled() && $this->do_change_record();
                           unset($this->savechange);
                           $this->recreate_fdd();
                 }                  }
                 elseif ($this->morechange == $this->labels['Apply']) {                  elseif ($this->morechange == $this->labels['Apply']) {
                         $this->change_enabled() && $this->do_change_record();                          $this->change_enabled() && $this->do_change_record();
Line 2809  function phpMyEdit_filter_handler(theFor
Line 2832  function phpMyEdit_filter_handler(theFor
                 }                  }
                 elseif ($this->savedelete == $this->labels['Delete']) {                  elseif ($this->savedelete == $this->labels['Delete']) {
                         $this->delete_enabled() && $this->do_delete_record();                          $this->delete_enabled() && $this->do_delete_record();
                           unset($this->savedelete);
                           $this->recreate_fdd();
                 }                  }
   
                 /*                  /*
Line 2940  function phpMyEdit_filter_handler(theFor
Line 2965  function phpMyEdit_filter_handler(theFor
                 $this->savechange   = $this->get_cgi_var('savechange');                  $this->savechange   = $this->get_cgi_var('savechange');
                 $this->morechange   = $this->get_cgi_var('morechange');                  $this->morechange   = $this->get_cgi_var('morechange');
                 $this->cancelchange = $this->get_cgi_var('cancelchange');                  $this->cancelchange = $this->get_cgi_var('cancelchange');
                   $this->savecopy     = $this->get_cgi_var('savecopy');
                   $this->cancelcopy   = $this->get_cgi_var('cancelcopy');
                 $this->savedelete   = $this->get_cgi_var('savedelete');                  $this->savedelete   = $this->get_cgi_var('savedelete');
                 $this->canceldelete = $this->get_cgi_var('canceldelete');                  $this->canceldelete = $this->get_cgi_var('canceldelete');
                 $this->cancelview   = $this->get_cgi_var('cancelview');                  $this->cancelview   = $this->get_cgi_var('cancelview');

Legend:
Removed from v.1.133  
changed lines
  Added in v.1.134

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