~ubuntu-branches/ubuntu/quantal/cacti/quantal

« back to all changes in this revision

Viewing changes to tree.php

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2010-08-17 22:22:02 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100817222202-4a173d1dfbfswz71
Tags: 0.8.7g-1
* New upstream release (Closes: #592465).
* Update context in 05_no-adodb.patch to remove fuzz.
* Remove "official" patches from previous release.
* Remove 563955_undefined_index_local_data_id.patch, incorporated upstream.
* Remove CVE-2010-2092.patch, incorporated upstream.
* Import new batch of "official" upstream patches.
* Update apache configuration to work in FastCGI deployments (Closes: #593203).
   - thanks to Thijs Kinkhorst <thijs@uvt.nl> (Closes: #578909).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
/*
3
3
 +-------------------------------------------------------------------------+
4
 
 | Copyright (C) 2004-2009 The Cacti Group                                 |
 
4
 | Copyright (C) 2004-2010 The Cacti Group                                 |
5
5
 |                                                                         |
6
6
 | This program is free software; you can redistribute it and/or           |
7
7
 | modify it under the terms of the GNU General Public License             |
111
111
                        }
112
112
                }
113
113
 
114
 
                if ((is_error_message()) || (empty($_POST["id"]))) {
115
 
                        header("Location: tree.php?action=edit&id=" . (empty($tree_id) ? $_POST["id"] : $tree_id));
116
 
                }else{
117
 
                        header("Location: tree.php");
118
 
                }
 
114
                header("Location: tree.php?action=edit&id=" . (empty($tree_id) ? $_POST["id"] : $tree_id));
119
115
        }elseif (isset($_POST["save_component_tree_item"])) {
120
116
                $tree_item_id = api_tree_item_save($_POST["id"], $_POST["graph_tree_id"], $_POST["type"], $_POST["parent_item_id"],
121
117
                        (isset($_POST["title"]) ? $_POST["title"] : ""), (isset($_POST["local_graph_id"]) ? $_POST["local_graph_id"] : "0"),
162
158
 
163
159
        $tree_sort_type = db_fetch_cell("select sort_type from graph_tree where id='" . $_GET["tree_id"] . "'");
164
160
 
 
161
        print "<form method='post' action='tree.php' name='form_tree'>\n";
 
162
 
165
163
        html_start_box("<strong>Tree Items</strong>", "100%", $colors["header"], "3", "center", "");
166
164
 
167
 
        print "<form method='post' action='tree.php' name='form_tree'>\n";
168
 
 
169
165
        form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],0); ?>
170
166
                <td width="50%">
171
167
                        <font class="textEditTitle">Parent Item</font><br>
255
251
                <?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],1); ?>
256
252
                        <td width="50%">
257
253
                                <font class="textEditTitle">Round Robin Archive</font><br>
258
 
                                Choose a round robin archive to control how this graph is displayed.
 
254
                                Choose a round robin archive to control how the Graph Thumbnail is displayed when using Tree Export.
259
255
                        </td>
260
256
                        <td>
261
257
                                <?php form_dropdown("rra_id", db_fetch_assoc("select id,name from rra order by timespan"), "name", "id", (isset($tree_item["rra_id"]) ? $tree_item["rra_id"] : ""), "", "");?>
282
278
                                <?php form_dropdown("host_grouping_type", $host_group_types, "", "", (isset($tree_item["host_grouping_type"]) ? $tree_item["host_grouping_type"] : "1"), "", "");?>
283
279
                        </td>
284
280
                </tr>
 
281
                <?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],1); ?>
 
282
                        <td width="50%">
 
283
                                <font class="textEditTitle">Round Robin Archive</font><br>
 
284
                                Choose a round robin archive to control how Graph Thumbnails are displayed when using Tree Export.
 
285
                        </td>
 
286
                        <td>
 
287
                                <?php form_dropdown("rra_id", db_fetch_assoc("select id,name from rra order by timespan"), "name", "id", (isset($tree_item["rra_id"]) ? $tree_item["rra_id"] : ""), "", "");?>
 
288
                        </td>
 
289
                </tr>
285
290
                <?php
286
291
                break;
287
292
        }
349
354
                }
350
355
 
351
356
                include("./include/top_header.php");
352
 
                form_confirm("Are You Sure?", $text, "tree.php?action=edit&id=" . $_GET["tree_id"], "tree.php?action=item_remove&id=" . $_GET["id"] . "&tree_id=" . $_GET["tree_id"]);
 
357
                form_confirm("Are You Sure?", $text, htmlspecialchars("tree.php?action=edit&id=" . $_GET["tree_id"]), htmlspecialchars("tree.php?action=item_remove&id=" . $_GET["id"] . "&tree_id=" . $_GET["tree_id"]));
353
358
                include("./include/bottom_footer.php");
354
359
                exit;
355
360
        }
378
383
 
379
384
        if ((read_config_option("deletion_verification") == "on") && (!isset($_GET["confirm"]))) {
380
385
                include("./include/top_header.php");
381
 
                form_confirm("Are You Sure?", "Are you sure you want to delete the tree <strong>'" . db_fetch_cell("select name from graph_tree where id=" . $_GET["id"]) . "'</strong>?", "tree.php", "tree.php?action=remove&id=" . $_GET["id"]);
 
386
                form_confirm("Are You Sure?", "Are you sure you want to delete the tree <strong>'" . db_fetch_cell("select name from graph_tree where id=" . $_GET["id"]) . "'</strong>?", htmlspecialchars("tree.php"), htmlspecialchars("tree.php?action=remove&id=" . $_GET["id"]));
382
387
                include("./include/bottom_footer.php");
383
388
                exit;
384
389
        }
409
414
 
410
415
        if (!empty($_GET["id"])) {
411
416
                $tree = db_fetch_row("select * from graph_tree where id=" . $_GET["id"]);
412
 
                $header_label = "[edit: " . $tree["name"] . "]";
 
417
                $header_label = "[edit: " . htmlspecialchars($tree["name"]) . "]";
413
418
        }else{
414
419
                $header_label = "[new]";
415
420
        }
428
433
 
429
434
                ?>
430
435
                <td>
431
 
                <a href='tree.php?action=edit&id=<?php print $_GET["id"];?>&subaction=expand_all'><img src='images/button_expand_all.gif' border='0' alt='Expand All'></a>
432
 
                <a href='tree.php?action=edit&id=<?php print $_GET["id"];?>&subaction=colapse_all'><img src='images/button_colapse_all.gif' border='0' alt='Colapse All'></a>
 
436
                <input type='button' onClick='return document.location="tree.php?action=edit&id=<?php print $_GET["id"];?>&subaction=expand_all"' value='Expand All' title='Expand All Trees'>
 
437
                <input type='button' onClick='return document.location="tree.php?action=edit&id=<?php print $_GET["id"];?>&subaction=collapse_all"' value='Collapse All' title='Collapse All Trees'></a>
433
438
                </td>
434
439
                <?php
435
440
 
443
448
                html_end_box();
444
449
        }
445
450
 
446
 
        form_save_button("tree.php");
 
451
        form_save_button("tree.php", "return");
447
452
}
448
453
 
449
454
function tree() {
464
469
                form_alternate_row_color($colors["alternate"],$colors["light"],$i); $i++;
465
470
                        ?>
466
471
                        <td>
467
 
                                <a class="linkEditMain" href="tree.php?action=edit&id=<?php print $tree["id"];?>"><?php print $tree["name"];?></a>
 
472
                                <a class="linkEditMain" href="<?php print htmlspecialchars("tree.php?action=edit&id=" . $tree["id"]);?>"><?php print htmlspecialchars($tree["name"]);?></a>
468
473
                        </td>
469
474
                        <td align="right">
470
 
                                <a href="tree.php?action=remove&id=<?php print $tree["id"];?>"><img src="images/delete_icon.gif" width="10" height="10" border="0" alt="Delete"></a>
 
475
                                <a href="<?php print htmlspecialchars("tree.php?action=remove&id=" . $tree["id"]);?>"><img src="images/delete_icon.gif" style="height:10px;width:10px;" border="0" alt="Delete"></a>
471
476
                        </td>
472
477
                </tr>
473
478
        <?php