Last active
May 29, 2016 20:36
-
-
Save swelljoe/9bea4a0760f788b12d236466199b1973 to your computer and use it in GitHub Desktop.
Lookup table version of print_category function in Authentic
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
| sub print_category { | |
| my ( $c, $label ) = @_; | |
| $label = $c eq "others" ? $text{'left_others'} : $label; | |
| my %icon_table = ( | |
| 'webmin' => 'fa-cog', | |
| 'usermin' => 'fa-cog', | |
| 'settings' => 'fa-cog', | |
| 'global_settings' => 'fa-cog', | |
| 'cat_settings' => 'fa-cog', | |
| 'system' => 'fa-wrench', | |
| 'servers' => 'fa-rocket', | |
| 'other' => 'fa-gavel', | |
| 'net' => 'fa-sheild', | |
| 'info' => 'fa-info', | |
| 'hardware' => 'fa-hdd-o', | |
| 'global_hardware' => 'fa-hdd-o', | |
| 'global_storage' => 'fa-hdd-o', | |
| 'cluster' => 'fa-power-off', | |
| 'global_cluster' => 'fa-power-off', | |
| 'unused' => 'fa-puzzle-piece', | |
| 'global_unused' => 'pa-puzzle-piece', | |
| 'mail' => 'fa-envelope', | |
| 'global_mail' => 'fa-envelope', | |
| 'email' => 'fa-envelope', | |
| 'global_email' => 'fa-envelope', | |
| 'login' => 'fa-user', | |
| 'global_login' => 'fa-user', | |
| 'apps' => 'fa-rocket', | |
| 'global_apps' => 'fa-rocket', | |
| 'custom' => 'fa-wrench', | |
| 'global_custom' => 'fa-wrench', | |
| 'ip' => 'fa-shield', | |
| 'global_ip' => 'fa-shield', | |
| 'check' => 'fa-user-md', | |
| 'global_check' => 'fa-user-md', | |
| 'add' => 'fa-plus', | |
| 'global_add' => 'fa-plus', | |
| 'backup' => 'fa-floppy-o', | |
| 'global_backup' => 'fa-floppy-o', | |
| 'global_server', => 'fa-cogs', | |
| 'cat_server', => 'fa-cogs'. | |
| 'global_system' => 'fa-cogs', | |
| 'global_delete' => 'fa-plug', | |
| 'cat_delete' => 'fa-plug', | |
| 'global_logs' => 'fa-file-text', | |
| 'cat_logs' => 'fa-file-text', | |
| 'global_services' => 'fa-puzzle-piece', | |
| 'cat_services' => 'fa-puzzle-piece', | |
| 'create_new' => 'fa-plus', | |
| 'global_gce' => 'fa-google', | |
| 'global_ec2' => 'fa-cubes', | |
| 'global_hosts' => 'fa-globe', | |
| 'global_virtualmin' => 'fa-sun-o', | |
| 'global_owners' => 'fa-users-o', | |
| 'global_monitor' => 'fa-desktop', | |
| 'global_settings' => 'fa-cloud', | |
| 'cat_manage' => 'fa-gavel', | |
| 'cat_res' => 'fa-share-alt', | |
| 'global_admin' => 'fa-key', | |
| 'cat_admin' => 'fa-key', | |
| 'global_power' => 'fa-power-off', | |
| 'cat_power' => 'fa-power-off', | |
| ); | |
| my $icon = $icon_table{$c} || 'fa-link'; | |
| if ($label) { | |
| # Show link to close or open catgory | |
| print '<li class="has-sub">' . "\n"; | |
| print '<a href="#' . $c . '"><i class="fa ' . $icon . ' fa-fw"></i> <span>' . $label . '</span></a>' . "\n"; | |
| print '</li>' . "\n"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment