Changeset 11332

Show
Ignore:
Timestamp:
07/24/07 13:34:25 (1 year ago)
Author:
bergie
Message:

Codepress for editing typical PHP fields, try validating the code before saving. refs #36

Files:

Legend:

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

    r10966 r11332  
    9191            { 
    9292                // In case that the type validation fails, we bail with generate_error, until 
     93                foreach ($this->datamanager->validation_errors as $field => $error) 
     94                { 
     95                    $this->formmanager->form->setElementError($field, $error); 
     96                } 
     97                return 'edit'; 
    9398                // we have a better defined way-of-life here. 
    9499                $_MIDCOM->generate_error(MIDCOM_ERRCRIT, 
  • trunk/midcom/midcom.helper.datamanager2/documentation/CHANGES

    r11121 r11332  
    88  which might even break existing functionality. 
    99- All items marked with "+" represent completely new features. 
     10 
     112007-07-24 bergie 
     12  + Implemented new "php" type that will validate code for parse errors 
    1013 
    11142007-07-09 bergie 
  • trunk/midcom/midgard.admin.asgard/documentation/CHANGES

    r6151 r11332  
    88  which might even break existing functionality. 
    99- All items marked with "+" represent completly new features. 
     10 
     112007-07-24 bergie 
     12  + Started using validation for typical PHP code fields 
    1013 
    11142007-06-02 bergie 
  • trunk/midcom/midgard.admin.asgard/handler/object/manage.php

    r11265 r11332  
    373373                    // Figure out nice size for the editing field 
    374374 
    375                     $output_mode = ""
    376                     $widget = "textarea"
    377  
     375                    $output_mode = ''
     376                    $widget = 'textarea'
     377                    $dm_type = 'text'; 
    378378 
    379379                    switch ($key) 
     
    382382                        case 'description': 
    383383                            $height = 30; 
    384                             $output_mode = "html"
    385                             $widget = "tinymce"
     384                            $output_mode = 'html'
     385                            $widget = 'tinymce'
    386386                            break; 
    387387                        case 'value': 
     
    389389                            // These are typical "large" fields 
    390390                            $height = 30; 
    391                             $output_mode = "code"; 
    392                             $widget = "textarea"; 
     391                            $dm_type = 'php'; 
     392                            $output_mode = 'code'; 
     393                            $widget = 'codepress'; 
    393394                            break; 
    394395                             
     
    405406                            'title'       => $key, 
    406407                            'storage'     => $key, 
    407                             'type'        => 'text'
     408                            'type'        => $dm_type
    408409                            'type_config' => Array 
    409410                            (