This commit is contained in:
Paminger
2016-06-20 08:36:37 +02:00
parent 377b1ecdd0
commit 68963a962a
3 changed files with 38 additions and 44 deletions
+27 -39
View File
@@ -13,47 +13,35 @@ class jsonforms_widget extends Widget
if (! isset($data['id']))
$data['id'] = 'jsonforms';
if (! isset($data['style']))
$data['style'] = 'width: 500px; height: 200px;';
$data['style'] = 'width: 50%; ';
if (! isset($data['schema']))
$data['schema'] = '{
"$schema": "http://json-schema.org/draft-03/schema#",
"title": "Person",
"type": "object",
"properties": {
"anrede": {
"type": "string",
"enum": [
"Herr",
"Frau"
],
"default": "Herr"
},
"vorname": {
"type": "string",
"description": "Firstname",
"minLength": 2,
"default": "Vorname"
},
"nachname": {
"type": "string",
"description": "Firstname",
"minLength": 2,
"default": "Nachname"
},
"code": {
"type": "string",
"description": "Accesscode",
"minLength": 6,
"default": "1q2w3e4r5t6z7u8i9o0"
},
"link": {
"type": "string",
"description": "LoginURL",
"minLength": 6,
"default": "https://cis.fhcomplete.org"
}
}
}';
"$schema": "http://json-schema.org/draft-03/schema#",
"title": "Person",
"type": "object",
"properties": {
"anrede": {
"type": "string",
"enum": [
"Herr",
"Frau"
],
"default": "Herr"
},
"vorname": {
"type": "string",
"description": "Firstname",
"minLength": 2,
"default": "Vorname"
},
"nachname": {
"type": "string",
"description": "Surename",
"minLength": 2,
"default": "Nachname"
}
}
}';
$this->view('widgets/jsonforms', $data);
}
}