Cacti (home)ForumsDocumentation

Differences

This shows you the differences between two versions of the page.

plugins.convert [2011/08/15 19:10]
gandalf created
plugins.convert [2019/10/29 15:16] (current)
Line 1: Line 1:
-  * change function calls from api_plugin_* to plugin_* +====== Plugin Conversion ====== 
-  * internationalize all texts shown to the user: use __("text"); create <plugin>.po file+ 
 +  * change function calls from <code>api_plugin_*</code> to <code>plugin_*</code> 
 +  * internationalize all texts shown to the user: use <code>__("text")</code>; create <plugin>.po file
   * internationalize date/time   * internationalize date/time
-  * pay attention to $menu indexes, often set in <plugin>_config_arrays; e.g. $menu["Utilities"] now goes $menu["utilities"]["items"]+  * pay attention to $menu indexes, often set in <plugin>_config_arrays; e.g. <code>$menu["Utilities"]</code> now goes <code>$menu["utilities"]["items"]</code> 
 +  * 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. 
 +      * <code>html_start_box($title, $width, $cell_padding, $align, $add_text = "", $collapsing = false, $table_id = "")</code>old 3rd parameter $colors has gone 
 +      * html_header_sort_checkbox expects $display_text in new format: <code> array( 
 + "name" => array( 
 + "name" => __("CDEF Title"), 
 + "order" => "ASC", 
 + "filter" => true, 
 + "link" => true 
 + ), 
 + "id" => array( 
 + "name" => __("ID"), 
 + "align" => "right", 
 + "order" => "ASC" 
 +
 + );</code> 
 + 
 +  * $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: \\ <code>function form_alternate_row_color($row_id = "", $hover = false, $row_class = "")</code> AND THE USE OF A COUNTER LIKE $I IS NO LONGER REQUIRED 
 +  * use <code>function html_create_nav($current_page, $max_pages, $rows_per_page, $total_rows, $columns, $base_url, $page_var = "page")</code> to create nav bar, e.g. \\ <code>$nav = html_create_nav($_REQUEST["page"], MAX_DISPLAY_PAGES, $_REQUEST["rows"], $total_rows, 8, 'rrdcleaner.php' . (strlen($_REQUEST["filter"]) ? "?filter=" . $_REQUEST["filter"]:""));</code> 





Personal Tools