comparison Lib/IMPL/Web/Application/ControllerUnit.pm @ 126:c8dfbbdd8005

Several bug fixes Forms support pre-alfa version
author wizard
date Fri, 11 Jun 2010 04:29:51 +0400
parents 7b14e0122b79
children 0dce0470a3d8
comparison
equal deleted inserted replaced
125:a4b0a819bbda 126:c8dfbbdd8005
104 $schema, 104 $schema,
105 $form 105 $form
106 ); 106 );
107 107
108 $result{formSchema} = $schema; 108 $result{formSchema} = $schema;
109 $result{formData} = $transform->Transform($self->query); 109 $result{formData} = $transform->Transform($action->query);
110
110 111
111 if ($process) { 112 if ($process) {
112 $result{formErrors} = $transform->Errors->as_list; 113 $result{formErrors} = $transform->Errors->as_list;
113 if ($transform->Errors->Count) { 114 if ($transform->Errors->Count) {
114 $result{state} = STATE_INVALID; 115 $result{state} = STATE_INVALID;
125 } 126 }
126 127
127 sub loadSchema { 128 sub loadSchema {
128 my ($self,$name) = @_; 129 my ($self,$name) = @_;
129 130
130 my ($vol,$dir,$file) = File::Spec->splitpath( Class::Inspector->resolved_filename(ref $self || $self) ); 131 if (-f $name) {
131 132 return IMPL::DOM::Schema->LoadSchema($name);
132 return IMPL::DOM::Schema->LoadSchema(File::Spec->catfile($vol,$dir,$name)); 133 } else {
134 my ($vol,$dir,$file) = File::Spec->splitpath( Class::Inspector->resolved_filename(ref $self || $self) );
135
136 return IMPL::DOM::Schema->LoadSchema(File::Spec->catfile($vol,$dir,$name));
137 }
133 } 138 }
134 139
135 1; 140 1;
136 141
137 __END__ 142 __END__