.\2', $iitc_details['@version'] ); print "

IITC version $iitc_version

\n"; print "Download\n"; } function iitcDesktopPluginDownloadTable ( $build ) { $categories = Array ( 'Portal Info' => "Enhanced information on the selected portal", 'Info' => "Display additional information", 'Keys' => "Manual key management", 'Controls' => "Map controls/widgets", 'Highlighter' => "Portal highlighters", 'Layer' => "Additional map layers", 'Map Tiles' => "Alternative map layers", 'Tweaks' => "Adjust IITC settings", 'Misc' => "Unclassified plugins", ); $plugins = Array(); foreach ( glob ( "$build/plugins/*.user.js" ) as $path ) { $basename = basename ( $path, ".user.js" ); $details = loadUserScriptHeader ( $path ); $plugins[$basename] = $details; $category = array_key_exists('@category',$details) ? $details['@category'] : 'Misc'; if ( !array_key_exists($category,$categories) ) { # add missing categories $categories[$category] = ''; } } ksort ( $plugins ); ?> $category_desc ) { print "\n"; $empty = True; foreach ( $plugins as $basename => $details ) { $path = "$build/plugins/$basename.user.js"; $this_category = array_key_exists('@category',$details) ? $details['@category'] : 'Misc'; if ( $category != $this_category ) continue; $empty = False; print "\n"; # remove 'IITC Plugin: ' prefix if it's there, for neatness $name = preg_replace ( '/^IITC plugin: /i', '', $details['@name'] ); # format extended version info in less prominant font $version = preg_replace ( '/^(\d+\.\d+\.\d+)\.(\d{8}\.\d{6})/', '\1.\2', $details['@version'] ); # remove unneeded prefix from description $description = preg_replace ( '/^\[[^]]*\] */', '', $details['@description'] ); print ""; print ""; print ""; print ""; print "\n"; } if ( $empty ) print "\n"; } ?>
Name ID / Version Description Download
Category: $category$category_desc
$name$basename
$version
$descriptionDownload
(no plugins in this category)