function display_plugin_cats($iconsize = "32") { global $SCERROR; global $sysType; global $allPBI; ?> <center>- <b>Categories</b> -      </center><br> <?php // Get a list of available plugins $sccmd = array("pbi list cages"); $response = send_sc_query($sccmd); $plugarray = $response["pbi list cages"]; // Get all the PBI categories $sccmd = array("pbi list allcats"); $response = send_sc_query($sccmd); $catlist = $response["pbi list allcats"]; foreach ($catlist as $cat) { if (empty($cat)) { continue; } // Skip any categories which have no entries if (array_search_partial($cat, $plugarray) == false) { continue; } $sccmd = array("pbi cat {$cat} name", "pbi cat {$cat} icon", "pbi cat {$cat} comment"); $response = send_sc_query($sccmd); $catname = $response["pbi cat {$cat} name"]; $caticon = $response["pbi cat {$cat} icon"]; $catcomment = $response["pbi cat {$cat} comment"]; echo "<img height={$iconsize} width={$iconsize} src=\"/images/pbiicon.php?i={$caticon}\"><a href=\"?p=plugins&cat={$cat}\" class=\"tooltip\" title=\"{$catcomment}\">{$catname}</a><br>\n"; } }
$pbiname = $pbiarray["{$cmd} name"]; $pbiicon = $pbiarray["{$cmd} icon"]; $pbidesc = $pbiarray["{$cmd} description"]; $pbiss = $pbiarray["{$cmd} screenshots"]; $pbitags = $pbiarray["{$cmd} tags"]; $pbiweb = $pbiarray["{$cmd} website"]; if ($pbiss == " ") { $pbiss = ""; } if (empty($pbiname) or $pbiname == " ") { die("No such app: {$pbi}"); } // Check if this app is installed $pkgoutput = syscache_ins_plugin_list(); $pkglist = explode(", ", $pkgoutput); if (array_search_partial($pbiorigin . " ", $pkglist) !== false) { $pbiInstalled = true; } else { $pbiInstalled = false; } $hasService = false; $hasConfig = false; $pbirunning = false; // Now check if this jail / plugin is running if ($pbiInstalled) { $ioid = get_iocage_id_from_origin($pbiorigin); $jail = $ioid; $pbirunning = is_pbicage_running($ioid); } if ($pbirunning) { $cmd = "jail {$ioid}";
function display_plugin_cats($iconsize = "32") { global $sc; global $jailUrl; global $jail; global $SCERROR; global $sysType; global $allPBI; ?> <center>- <b>Categories</b> -      </center><br> <?php // Get a list of available plugins $pcmd = "pbi list cages"; exec("{$sc} " . escapeshellarg($pcmd), $plugarray); // Get all the PBI categories $listcmd = "pbi list allcats"; exec("{$sc} " . escapeshellarg($listcmd), $catarray); $catlist = explode(", ", $catarray[0]); foreach ($catlist as $cat) { if (empty($cat)) { continue; } // Skip any categories which have no entries if (array_search_partial($cat, $plugarray) == false) { continue; } exec("{$sc} " . escapeshellarg("pbi cat {$cat} name") . " " . escapeshellarg("pbi cat {$cat} icon") . " " . escapeshellarg("pbi cat {$cat} comment"), $catdetails); if ("{$catdetails['0']}" == "{$SCERROR}") { continue; } echo "<img height={$iconsize} width={$iconsize} src=\"/images/pbiicon.php?i={$catdetails['1']}\"><a href=\"?p=plugins&cat={$cat}\" title=\"{$catdetails['2']}\">{$catdetails['0']}</a><br>\n"; unset($catdetails); } }