Take two:
[www-register-wizard.git] / application / views / AddConfFile.php
1 <script language="javascript">
2
3 function updateNodeCombo()
4 {
5   node_ids= document.fm.node_ids;
6   nodegroup_ids= document.fm.nodegroup_ids;
7   scope= document.fm.scope;
8
9   for ( var i=0; i < scope.length ; i++ )
10   {
11         if ( scope[i].checked )
12         {
13           switch( scope[i].value )
14           {
15           case "global":
16                 node_ids.disabled= 1;
17                 nodegroup_ids.disabled= 1;
18                 break;
19
20           case "group":
21                 node_ids.disabled= 1;
22                 nodegroup_ids.disabled= 0;
23                 break;
24
25           case "node":
26                 node_ids.disabled= 0;
27                 nodegroup_ids.disabled= 1;
28                 break;
29           }
30         }
31   }
32 }
33
34 </script>
35
36
37 <a href="index.php">Return to listing...</a>
38 <form name='fm' action="conffile/add" method="post">
39 <input type="hidden" name="submitted" value="1">
40
41 <p><table width=100% cellpadding=5 border=0>
42
43 <tr>
44 <td></td>
45 <td>
46         <input type=checkbox <?= $this->validation->set_checkbox('enabled', $this->validation->enabled ) ?> 
47                         name="enabled">Enabled</input>
48         <?= $this->validation->enabled_error ?>
49 </td>
50 </tr>
51 <tr>
52 <td>File Scope:</td>
53 <td>
54 <input type='radio' name='scope' value='global' onClick="updateNodeCombo();" <?= ( $scope == "global" ?  "checked" : "" ) ?>> Global<br>
55 <input type='radio' name='scope' value='node' onClick="updateNodeCombo();" <?= ( $scope == "node" ?  "checked" : "" ) ?>> Node : 
56         <select name="node_ids">
57         <?php foreach( $nodes as $node ): ?>
58                 <option $selected value="<?= $node['node_id'] ?>"><?= $node['hostname'] ?></option>
59         <?php endforeach; ?>
60         </select>
61 <br>
62
63 <input type='radio' name='scope' value='group' onChange="updateNodeCombo();" <?= ( $scope == "group" ?  "checked" : "" ) ?>> Group : 
64         <select name="nodegroup_ids">
65         <?php foreach( $nodegroups as $nodegroup ): ?>
66                   <option value="<?= $nodegroup['nodegroup_id'] ?>"><?= $nodegroup['name'] ?></option>
67         <?php endforeach; ?>
68         </select></td>
69
70 </td>
71 </tr>
72
73 <tr>
74 <td>Source:</td>
75 <td><i>http://<?= PLC_BOOT_HOST ?>/</i> 
76 <input name="source" value="<?= htmlspecialchars($this->validation->source) ?>" size=40 maxlength=255>
77 <?= $this->validation->source_error ?>
78 </td>
79 </tr>
80
81 <tr>
82 <td>Destination:</td>
83 <td>
84 <input name="dest" value="<?= htmlspecialchars($this->validation->dest) ?>" size=40 maxlength=255>
85 <?= $this->validation->dest_error ?>
86 </td>
87 </tr>
88
89 <tr>
90 <td>Permissions:</td>
91 <td>
92 <input name="file_permissions" value="<?= htmlspecialchars($this->validation->file_permissions) ?>" size=5 maxlength=20>
93 <?= $this->validation->file_permissions_error ?>
94 </td>
95 </tr>
96
97 <tr>
98 <td>Owner:</td>
99 <td>
100 <input name="file_owner" value="<?= htmlspecialchars($this->validation->file_owner) ?>" size=15 maxlength=50>
101 <?= $this->validation->file_owner_error ?>
102 </td>
103 </tr>
104
105 <tr>
106 <td>Group:</td>
107 <td>
108 <input name="file_group" value="<?= htmlspecialchars($this->validation->file_group) ?>" size=15 maxlength=50>
109 <?= $this->validation->file_group_error ?>
110 </td>
111 </tr>
112
113 <tr>
114 <td>Pre-Install Command:</td>
115 <td>
116 <input name="preinstall_cmd" value='<?= htmlspecialchars($this->validation->preinstall_cmd) ?>' size=70 maxlength=1024>
117 <?= $this->validation->preinstall_cmd_error ?>
118 </td>
119 </tr>
120
121 <tr>
122 <td>Post-Install Command:</td>
123 <td>
124 <input name="postinstall_cmd" value='<?= htmlspecialchars($this->validation->postinstall_cmd) ?>' size=70 maxlength=1024>
125 <?= $this->validation->postinstall_cmd_error ?>
126 </td>
127 </tr>
128
129 <tr>
130 <td>Error Command:</td>
131 <td>
132 <input name="error_cmd" value='<?= htmlspecialchars($this->validation->error_cmd) ?>' size=70 maxlength=1024>
133 <?= $this->validation->postinstall_cmd_error ?>
134 <br>
135 (run if an error occured, regardless if errors are being ignored)</td>
136 </tr>
137
138 <tr>
139 <td></td>
140 <td>
141         <input type=checkbox <?= $this->validation->set_checkbox('ignore_cmd_errors', $this->validation->ignore_cmd_errors) ?> 
142                         name="ignore_cmd_errors">Ignore pre/post install command errors</input>
143         <?= $this->validation->ignore_cmd_errors_error?>
144 </td>
145 </tr>
146
147
148 <tr>
149 <td></td>
150 <td>
151         <input type=checkbox <?= $this->validation->set_checkbox('always_update', $this->validation->always_update) ?> 
152                         name="always_update">Always update this file, even if same as original</input>
153         <?= $this->validation->always_update_error?>
154 </td>
155 </tr>
156
157 <tr>
158 <td><input type="submit" value="<?= htmlspecialchars($submit_caption) ?>"></td>
159 </tr>
160
161
162 </table>
163 </form>
164 <script language="javascript">
165 updateNodeCombo();
166 </script>