ona  18.1.1
About: OpenNetAdmin provides a database managed inventory of your IP network (with Web and CLI interface).
  Fossies Dox: ona-18.1.1.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

main.inc.php
Go to the documentation of this file.
1 <?php
2 
4 
5 // Calculate the percentage of the subnet that's used (total size - allocated hosts - dhcp pool size)
7 
8 if (auth('subnet_modify',$debug_val)) {
10  <a title="Edit subnet. ID: {$record['id']}"
11  class="act"
12  onClick="xajax_window_submit('edit_subnet', xajax.getFormValues('form_subnet_{$record['id']}'), 'editor');"
13  ><img src="{$images}/silk/page_edit.png" border="0"></a>
14 EOL;
15 }
16 if (auth('subnet_del',$debug_val)) {
17  $title_left_html .= <<<EOL
18  <a title="Delete subnet. ID: {$record['id']}"
19  class="act"
20  onClick="xajax_window_submit('tooltips', 'name=>edit_subnet', 'window_progressbar');xajax_window_submit('edit_subnet', xajax.getFormValues('form_subnet_{$record['id']}'), 'delete');"
21  ><img src="{$images}/silk/delete.png" border="0"></a>
22 EOL;
23 }
24 
26  <b>{$record['name']}</b>&nbsp;
28 
29 
30 
31 
33  <a href="?work_space={$extravars['window_name']}&subnet={$record['name']}"><img title="Direct link to {$record['name']}" src="{$images}/silk/application_link.png" border="0"></a>
34 EOL;
35 
36 
37 // Define the tag type
38 $tagtype = 'subnet';
39 // Print tag list
40 $modjs .= <<<EOL
41  xajax_window_submit('tooltips', 'type => {$tagtype}, reference => {$record['id']}, updateid => taglist_{$extravars['window_name']}', 'tag_html');
42 EOL;
43 
44 // print the add tag button if you have access
45 if (auth('host_add') or auth('subnet_add') ) {
46  // setup a tag quickfind button
47  $modjs .= <<<EOL
48 
49  /* Setup the Quick Find Tag icon */
50  var _button = el('qf_tag_{$extravars['window_name']}');
51  _button.style.cursor = 'pointer';
52  _button.onclick =
53  function(ev) {
54  if (!ev) ev = event;
55  /* Create the popup div */
56  wwTT(this, ev,
57  'id', 'tt_qf_tag_{$extravars['window_name']}',
58  'type', 'static',
59  'direction', 'south',
60  'delay', 0,
61  'styleClass', 'wwTT_qf',
62  'javascript',
63  "xajax_window_submit('tooltips', '" +
64  "tooltip=>qf_tag," +
65  "type=>{$tagtype}," +
66  "updateid=>taglist_{$extravars['window_name']}," +
67  "reference=>{$record['id']}," +
68  "id=>tt_qf_tag_{$extravars['window_name']}," +
69  "input_id=>set_tag_{$extravars['window_name']}');"
70  )
71  };
72 EOL;
73 
74  $addtaghtml .= <<<EOL
75  <span id="qf_tag_{$extravars['window_name']}">
76  <img title="Add a tag" src="{$images}/silk/tag_blue.png" border="0"
77  /></span>
78 EOL;
79 }
80 
81 // print the tag section into the workspace
83  <tr>
84  <td align="right" nowrap="true"><b>Tags</b>&nbsp;</td>
85  <td nowrap="true" class="tag" align="left" >
86  {$addtaghtml}
87  <span id='taglist_{$extravars['window_name']}'></span>
88  </td>
89  </tr>
90 EOL;
91 
92 
94 
95 
96  <table width=100% cellspacing="0" border="0" cellpadding="0" style="margin-bottom: 8px;">
97 EOL;
98 
99 // Display the vlan info line only if there is a vlan associated
100 if ($record['vlan_id']) {
101  $modbodyhtml .= <<<EOL
102  <tr>
103  <td align="right" nowrap="true"><b>Vlan</b>&nbsp;</td>
104  <td class="padding" align="left">
105  <a title="View Vlan Campus"
106  class="nav"
107  onClick="xajax_window_submit('work_space', 'xajax_window_submit(\'display_vlan_campus\', \'vlan_campus_id=>{$record['vlan_campus_id']}\', \'display\')');"
108  >{$record['vlan_campus_name']}</a>&nbsp;&#047;&nbsp;<a title="View Vlan"
109  class="nav"
110  onClick="xajax_window_submit('work_space', 'xajax_window_submit(\'display_vlan\', \'vlan_id=>{$record['vlan_id']}\', \'display\')');"
111  >{$record['vlan_name']}</a>
112  </td>
113  </tr>
114 EOL;
115  }
116 
117 $modbodyhtml .= <<<EOL
118  <tr>
119  <td align="right" nowrap="true"><b>IP Address</b>&nbsp;</td>
120  <td class="padding" align="left">
121  {$record['ip_addr']}&nbsp;
122  </td>
123  </tr>
124 
125  <tr>
126  <td align="right" nowrap="true"><b>Netmask</b>&nbsp;</td>
127  <td class="padding" align="left">{$record['ip_mask']} (/{$record['ip_subnet_mask_cidr']})&nbsp;</td>
128  </tr>
129 
130  <tr>
131  <td align="right" nowrap="true"><b>Usage</b>&nbsp;</td>
132  <td class="padding" align="left" valign="middle">{$usage_html}</td>
133  </tr>
134 
135  <tr>
136  <td align="right" nowrap="true"><b>Type</b>&nbsp;</td>
137  <td class="padding" align="left">{$record['type']}&nbsp;</td>
138  </tr>
139 
140  $taghtml
141  </table>
142 EOL;
143 
144  // Requires the include of the functions_network_map.inc.php file at the beginning of this file
145  $wspl = workspace_plugin_loader('subnet_map',$record,$extravars);
146  $modbodyhtml .= $wspl[0]; $modjs .= $wspl[1];
147 
148 ?>
workspace_plugin_loader
workspace_plugin_loader($modulename, $record=array(), $extravars=array())
Definition: functions_gui.inc.php:140
$tagtype
$tagtype
Definition: main.inc.php:38
$record
$record['display_name']
Definition: app_advanced_search.inc.php:12
$usage_html
$usage_html
Definition: main.inc.php:6
$modjs
$modjs
Definition: main.inc.php:41
$title_right_html
$title_right_html
Definition: main.inc.php:3
nbsp
</td >< td class="padding" align="left"></td ></tr >< tr >< td align="right" nowrap="true">< b > Netmask</b > & nbsp
Definition: main.inc.php:121
_button
_button
Definition: app_advanced_search.inc.php:48
$taghtml
if(auth('host_add') or auth('subnet_add')) $taghtml
Definition: main.inc.php:82
$modbodyhtml
$modbodyhtml
Definition: main.inc.php:5
get_subnet_usage_html
get_subnet_usage_html($subnet_id, $width=30, $height=8)
Definition: functions_gui.inc.php:294
EOL
EOL
Definition: main.inc.php:43
$wspl
$wspl
Definition: main.inc.php:113
auth
auth($resource, $msg_level=1)
Definition: functions_general.inc.php:1330
$title_left_html
$title_left_html
Definition: main.inc.php:3