Changeset 4705

Show
Ignore:
Timestamp:
12/04/06 12:21:46 (2 years ago)
Author:
bergie
Message:

Try to handle both checkboxes and AJAX mode in a sane way

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/midcom.helper.datamanager2/controller/simple.php

    r3199 r4705  
    8282 
    8383        $result = $this->formmanager->process_form(); 
    84  
     84        echo $this->datamanager->types['continuous']->value; 
    8585        // Handle successful save explicitly. 
    8686        if (   $result == 'save' 
  • trunk/src/midcom.helper.datamanager2/formmanager.php

    r4507 r4705  
    653653     * @return string One of 'editing', 'save', 'next', 'previous' and 'cancel' 
    654654     */ 
    655     function process_form(
     655    function process_form($ajax_mode = false
    656656    { 
    657657        $_MIDCOM->cache->content->no_cache(); 
     
    680680            foreach ($this->widgets as $name => $copy) 
    681681            { 
    682                 /*if (!array_key_exists($name, $results)) 
    683                 { 
    684                     $results[$name] = null; 
    685                 } 
    686                 $this->widgets[$name]->sync_type_with_widget($results); 
    687                 */ 
    688                 if (array_key_exists($name, $results)) 
    689                 { 
     682                if ($ajax_mode) 
     683                { 
     684                    if (array_key_exists($name, $results)) 
     685                    { 
     686                        $this->widgets[$name]->sync_type_with_widget($results); 
     687                    } 
     688                } 
     689                else 
     690                { 
     691                    if (!array_key_exists($name, $results)) 
     692                    { 
     693                        $results[$name] = null; 
     694                    } 
    690695                    $this->widgets[$name]->sync_type_with_widget($results); 
    691696                } 
  • trunk/src/midcom.helper.datamanager2/formmanager/ajax.php

    r4562 r4705  
    192192    function process_form() 
    193193    { 
    194         $this->_exitcode = parent::process_form(); 
     194        $this->_exitcode = parent::process_form(true); 
    195195 
    196196        // Process next/previous