'; $o .= '

' . t('Public Hubs') . '

'; $o .= '
' . t('The listed hubs allow public registration for the $Projectname network. All hubs in the network are interlinked so membership on any of them conveys membership in the network as a whole. Some hubs may require subscription or provide tiered service plans. The hub itself may provide additional details.') . '
' . EOL; $ret = z_fetch_url($url); if($ret['success']) { $j = json_decode($ret['body'],true); if($j) { if($j['sites']) { $projects = $this->sort_sites($j['sites']); foreach($projects as $p => $v) { if (ucfirst($p) === 'Osada') { // deprecated continue; } $o .= '' . ucfirst($p) . '' . EOL; $o .= ''; $o .= ''; usort($v, [ $this, 'sort_versions' ]); foreach ($v as $jj) { if(strpos($jj['version'],' ')) { $x = explode(' ', $jj['version']); if($x[1]) $jj['version'] = $x[1]; } $m = parse_url($jj['url']); $host = strtolower(substr($jj['url'],strpos($jj['url'],'://')+3)); $location = ''; if(!empty($jj['location'])) { $location = '

' . $jj['location'] . '

'; } else { $location = '
 '; } $urltext = str_replace(array('https://'), '', $jj['url']); $o .= ''; $o .= ''; } $o .= '
' . t('Hub URL') . '' . t('Access Type') . '' . t('Registration Policy') . '' . t('Software') . '
' . $urltext . '' . $location . '' . $jj['access'] . '' . $jj['register'] . '' . ucwords($jj['project']) . (($jj['version']) ? ' ' . $jj['version'] : '') . '
'; $o .= '

'; } } $o .= '
'; } } return $o; } function sort_sites($a) { $ret = []; if($a) { foreach($a as $e) { $projectname = explode(' ',$e['project']); $ret[$projectname[0]][] = $e; } } $projects = array_keys($ret); $newret = []; foreach($projects as $p) { $newret[$p] = $ret[$p]; } return $newret; } function sort_versions($a,$b) { return version_compare($b['version'],$a['version']); } }