You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feature: make the tags graph drilldown button an Enable/Disable Tags toggle - #25
Reworks this plugin's graph drilldown action button from a static link into a stateful Enable Tags / Disable Tags toggle, mirroring the Thold VRULE toggle pattern.
Cacti's graph action (drilldown) menu now renders each registered button's title as a visible text label. Rather than a static Tags link to the tags page, the button now toggles whether this plugin's tag legend lines are drawn on graphs, and its label reflects the current session state.
Changes
include/functions.php - plugin_tags_graph_button(): now flips a session draw-state (sess_config_array['tags_draw']) via a tags_draw request var and renders Enable Tags / Disable Tags (two complete i18n strings, not an appended On/Off fragment) with a toggle URL. Any existing tags_draw parameter is stripped first so a click never duplicates it.
include/functions.php - plugin_tags_rrd_graph_graph_options(): skips drawing the tag legend lines when the toggle is off. Tags are drawn by default, preserving prior behaviour.
tests/Unit/TagsGraphButtonTest.php - rewritten to cover every toggle branch, the URL dedup (including the first-parameter case), and the legend-draw gate; full standard GPL header.
tests/bootstrap-unit.php - add an isset_request_var stub (function_exists-guarded).
locales/po/cacti.pot - regenerated for the new Enable Tags / Disable Tags strings.
CHANGELOG.md - entry under develop.
Note on scope
This supersedes the original "shorten the title to Tags" scope: per maintainer direction the button becomes a state toggle instead of a navigation link. The Tags management page remains reachable from the console menu.
Testing
php -l - clean on all changed PHP files.
php tests/bin/check-i18n-pot.php origin/develop - OK (pot included).
Unit tests drive all toggle states, URL dedup across parameter positions, and the legend gate.
The graph action menu now renders each drilldown button's title as a visible label, so 'Show tags for this graph' reads as an overlong menu entry. Shorten it to 'Tags', add a unit test exercising plugin_tags_graph_button() so the changed line stays covered, and regenerate locales/po/cacti.pot.
Mirror thold's VRULE toggle: the graph drilldown button now flips a
session draw-state (sess_config_array['tags_draw']) and shows 'Enable Tags'
or 'Disable Tags' per that state, and plugin_tags_rrd_graph_graph_options()
skips drawing the tag legend lines when the toggle is off. Two complete
i18n strings (not an appended On/Off fragment) so the label stays
grammatical across translations. Rewrite the unit test to cover all toggle
branches + the legend gate, add the isset_request_var bootstrap stub, use
the full GPL header, and regenerate cacti.pot.
TheWitness
changed the title
issue: shorten tags graph drilldown button title to 'Tags'
feature: make the tags graph drilldown button an Enable/Disable Tags toggle
Oct 13, 2026
The new test still omits the warranty and Cacti Group attribution paragraphs from the required standard PHP GPL header; compare setup.php:2-23 and tests/Unit/CspNonceTest.php:2-23. Replace this abbreviated block with the complete repository header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reworks this plugin's graph drilldown action button from a static link into a stateful Enable Tags / Disable Tags toggle, mirroring the Thold VRULE toggle pattern.
Cacti's graph action (drilldown) menu now renders each registered button's
titleas a visible text label. Rather than a staticTagslink to the tags page, the button now toggles whether this plugin's tag legend lines are drawn on graphs, and its label reflects the current session state.Changes
include/functions.php-plugin_tags_graph_button(): now flips a session draw-state (sess_config_array['tags_draw']) via atags_drawrequest var and rendersEnable Tags/Disable Tags(two complete i18n strings, not an appended On/Off fragment) with a toggle URL. Any existingtags_drawparameter is stripped first so a click never duplicates it.include/functions.php-plugin_tags_rrd_graph_graph_options(): skips drawing the tag legend lines when the toggle is off. Tags are drawn by default, preserving prior behaviour.tests/Unit/TagsGraphButtonTest.php- rewritten to cover every toggle branch, the URL dedup (including the first-parameter case), and the legend-draw gate; full standard GPL header.tests/bootstrap-unit.php- add anisset_request_varstub (function_exists-guarded).locales/po/cacti.pot- regenerated for the newEnable Tags/Disable Tagsstrings.CHANGELOG.md- entry underdevelop.Note on scope
This supersedes the original "shorten the title to
Tags" scope: per maintainer direction the button becomes a state toggle instead of a navigation link. The Tags management page remains reachable from the console menu.Testing
php -l- clean on all changed PHP files.php tests/bin/check-i18n-pot.php origin/develop- OK (pot included).