chmod a-x editplant.pg
[L-seed.git] / web / php / page / editplant.pg
1 {
2         id: 'ContentPanel_createplant'
3         ,closable: true
4         ,style: 'padding: 5px;'
5         ,title: 'Pflanze editieren'
6         ,layout: 'form'
7         ,labelWidth: 100
8         ,baseCls: 'x-plain'
9         ,bodyStyle:'padding:5px;'
10         ,defaults: {
11                 bodyStyle:'padding:5px;'
12         }
13         ,tbar: [{
14                 text: "Save"
15                 ,icon: 'img/icons/disk.png'
16                 ,cls: 'x-btn-text-icon'
17                 ,handler: function() {
18                         var namefield = Ext.getCmp("editplantdefinitionnamefield");
19                         var planteditor = Ext.getCmp("editplantdefinitioneditor");
20                         if (namefield.isValid()) {
21                         
22                                 var plant = new Lseed.Plant({
23                                         Name: namefield.getValue() 
24                                         ,Code: planteditor.getValue()
25                                 });
26                                 editor.Save(plant);
27                         } else {
28                                 communication.showMessage("Ihre Pflanze benötigt einen Namen.", "error");
29                         }
30                 }
31         },{
32                 text: "CheckSyntax"
33                 ,icon: 'img/icons/accept.png'
34                 ,cls: 'x-btn-text-icon'
35                 ,handler: function() { 
36                         communication.waitForPage();
37                         var pdEditor = Ext.getCmp("editplantdefinitioneditor");
38                         var pnEditor = Ext.getCmp("editplantdefinitionnamefield");
39                         if (pdEditor && pnEditor) {
40                                 var name = pnEditor.getValue();
41                                 var code = pdEditor.getValue();
42                                 editor.CheckSyntax({data:{Code:code, Name:name}}, editor.HandleSyntaxCheckAnswerForEditor); 
43                         } else {
44                                 console.error("Lseed.Editor.CheckSyntaxCallback_Callback: 'plantdefinitioneditor' Could not be found.");
45                         }
46                 }.createDelegate(editor)
47         }]
48         ,items: [{
49                 id: "editplantdefinitionnamefield"
50                 ,xtype: 'textfield'
51                 ,name: 'name'
52                 ,allowBlank: false
53                 ,fieldLabel: 'Name der Pflanze'
54                 ,anchor:'100%'
55                 ,disabled: true
56                 ,enableKeyEvents: true
57                 ,listeners: {
58                 }
59         },{
60                 id: "editplantdefinitioneditor"
61                 ,xtype: 'textarea'
62                 ,name: 'code'
63                 ,fieldLabel: 'Pflanzendefinition'
64                 ,anchor:'100% -50'
65                 ,enableKeyEvents: true
66                 ,listeners: {
67                 }
68                 ,value: ''
69         }]
70 }