Hy,
i want to add a link in the Host Top links, but this link must have the current host ID.
how to do that ?
Laurent
device_edit_top_links
Moderators: Developers, Moderators
device_edit_top_links
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
php 5.2.14 - MySQL 5.1.47
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: device_edit_top_links
Are you talking about the links seen on top, when editing a single host?
Whcih method of adding your custom link do you prefer, by writing a plugin (using a plugin hook) or by simply patching the code?
Which base version of cacti are you using?
R.
Whcih method of adding your custom link do you prefer, by writing a plugin (using a plugin hook) or by simply patching the code?
Which base version of cacti are you using?
R.
Re: device_edit_top_links
hello,
Laurent
yesgandalf wrote:Are you talking about the links seen on top, when editing a single host?
i want to add this within a plugin, so using plugin hook.gandalf wrote:Whcih method of adding your custom link do you prefer, by writing a plugin (using a plugin hook) or by simply patching the code?
my cacti version is 0.8.7igandalf wrote:Which base version of cacti are you using?
Laurent
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
php 5.2.14 - MySQL 5.1.47
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: device_edit_top_links
The relevant part of code is So you will use the hook device_edit_top_links and may want to use get_request_var("id") as the id of the host. It would be safe to use as validation before using the id.
R.
Code: Select all
<td class="textInfo" valign="top">
<span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("graphs_new.php?host_id=" . $host["id"]);?>">Create Graphs for this Host</a><br>
<span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("data_sources.php?host_id=" . $host["id"] . "&ds_rows=30&filter=&template_id=-1&method_id=-1&page=1");?>">Data Source List</a><br>
<span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("graphs.php?host_id=" . $host["id"] . "&graph_rows=30&filter=&template_id=-1&page=1");?>">Graph List</a>
<?php api_plugin_hook('device_edit_top_links'); ?>
</td>
Code: Select all
/* ================= input validation ================= */
input_validate_input_number(get_request_var("id"));
/* ==================================================== */
R.
Re: device_edit_top_links
hy,
Great !
thanks a lot Gandalf.
Laurent
gandalf wrote:The relevant part of code isSo you will use the hook device_edit_top_links and may want to use get_request_var("id") as the id of the host. It would be safe to useCode: Select all
<td class="textInfo" valign="top"> <span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("graphs_new.php?host_id=" . $host["id"]);?>">Create Graphs for this Host</a><br> <span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("data_sources.php?host_id=" . $host["id"] . "&ds_rows=30&filter=&template_id=-1&method_id=-1&page=1");?>">Data Source List</a><br> <span style="color: #c16921;">*</span><a href="<?php print htmlspecialchars("graphs.php?host_id=" . $host["id"] . "&graph_rows=30&filter=&template_id=-1&page=1");?>">Graph List</a> <?php api_plugin_hook('device_edit_top_links'); ?> </td>
as validation before using the id.Code: Select all
/* ================= input validation ================= */ input_validate_input_number(get_request_var("id")); /* ==================================================== */
R.
Great !
thanks a lot Gandalf.
Laurent
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
php 5.2.14 - MySQL 5.1.47
Who is online
Users browsing this forum: No registered users and 0 guests