Cacti (home)ForumsDocumentation

Plugin Conversion

  • change function calls from
    api_plugin_*

    to

    plugin_*
  • internationalize all texts shown to the user: use
    __("text")

    ; create <plugin>.po file

  • internationalize date/time
  • pay attention to $menu indexes, often set in <plugin>_config_arrays; e.g.
    $menu["Utilities"]

    now goes

    $menu["utilities"]["items"]
  • after registering a new realm, often set in <plugin>_config_arrays call function plugin_load_realms() to load realms into global variable
  • table handling has changed, consider using the new table class! This will reduce more efforts, e.g. most $colors changes (see below) are related to table handling.
    • html_start_box($title, $width, $cell_padding, $align, $add_text = "", $collapsing = false, $table_id = "")

      old 3rd parameter $colors has gone

    • html_header_sort_checkbox expects $display_text in new format:
      	array(
      		"name" => array(
      			"name" => __("CDEF Title"),
      			"order" => "ASC",
      			"filter" => true,
      			"link" => true
      		),
      		"id" => array(
      			"name" => __("ID"),
      			"align" => "right",
      			"order" => "ASC"
      		)
      	);
  • $config has gone, replace e.g.
    • $config[“base_path”] by CACTI_BASE_PATH
    • $config[“rra_path”] by CACTI_RRA_PATH
    • $config[“url_path”] by CACTI_URL_PATH
    • $config[“library_path”] by CACTI_BASE_PATH . ”/lib”
    • $config[“include_path”] by CACTI_BASE_PATH . ”/include”
  • $colors has gone, replace e.g.
    • $colors[“alternate”] ⇒ class=”…”
    • $colors[“light”] ⇒ class=”…”
    • $colors[“header”] ⇒ class=“textHeaderDark”
    • $colors[“panel”] ⇒ class=“rowAlternate3”
  • form_alternate_row_color takes new parameters:
    function form_alternate_row_color($row_id = "", $hover = false, $row_class = "")

    AND THE USE OF A COUNTER LIKE $I IS NO LONGER REQUIRED

  • use
    function html_create_nav($current_page, $max_pages, $rows_per_page, $total_rows, $columns, $base_url, $page_var = "page")

    to create nav bar, e.g.

    $nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, $_REQUEST["rows"], $total_rows, 8, 'rrdcleaner.php' . (strlen($_REQUEST["filter"]) ? "?filter=" . $_REQUEST["filter"]:""));





Personal Tools