Take two:
[www-register-wizard.git] / application / views / ListConfFiles.php
1
2 <h2>All current node configuration files</h2>
3
4 <p>
5
6 <table width=100%>
7 <tr>
8 <th width=50%>Destination File <font size=-1>[click to view/edit details]</font></th>
9 <th width=40%>Scope</th>
10 <th width=10%>Enabled</th>
11 </tr>
12
13
14 <?php 
15         foreach( $all_conf_files as $conf_file )
16     {
17                 $conf_file_id  = $conf_file['conf_file_id'];
18                 $enabled       = $conf_file['enabled'];
19                 $dest          = $conf_file['dest'];
20                 $node_id       = $conf_file['node_ids'];
21                 $nodegroup_id  = $conf_file['nodegroup_ids'];
22
23                 if( $enabled == True )
24                         $enabled= "Yes";
25                 else
26                         $enabled= "No";
27
28                 // find out what the scope is for this conf file
29                 if( count($node_id) == 0 && count($nodegroup_id) == 0)
30                 {
31                         // if there is no associate entry, its a global scope
32                         $scope= "global";
33                 } else {
34                         if( count($nodegroup_id) == 0 && is_numeric($node_id[0]) )
35                         {
36                                 $nodes= $api->GetNodes( $node_id, array("hostname") );
37                                   
38                                 $hostname= $nodes[0]["hostname"];
39                                 $scope= "node: $hostname";
40                         } elseif(count($node_id) == 0 && is_numeric($nodegroup_id[0]) )
41                         {
42                                 $nodegroups= $api->GetNodeGroups( $nodegroup_id );
43                                 $group_name= $nodegroups[0]["name"];
44                                 $scope= "group: $group_name";
45                         }
46                 }
47       
48                 print( "<tr>\n<td>" );
49                 print( "<a href=\"conffile/update/$conf_file_id\">$dest</a></td>\n" );
50                 print( "<td>$scope</td>\n" );
51                 print( "<td>$enabled</td>\n</tr>\n" );
52         }
53 ?>
54
55
56 </tr>
57 </table>
58
59 <p><a href="edit.php?action=create">Create new...</a>
60 <br><a href="copy.php">Copy...</a>
61 <br><a href="delete.php">Delete...</a>
62
63 <p><br>
64 <h2>File scope priority</h2>
65
66 The following priority is applied to files that have the same destination:
67 <ol>
68 <li>Files that have a one-node scope
69 <li>Files that have a group scope
70 <li>Files that have a global scope
71 </ol>