additional_plugins/serendipity_event_oembed/oembed/ProviderList.php
2017-11-18 15:00:11 +01:00

20 lines
765 B
PHP

<?php
class ProviderList {
static function ul_providernames($with_url=false) {
$provider_names = array();
$xml = simplexml_load_string(file_get_contents(PLUGIN_OEMBED_PROVIDER_XML_FILE));// PROVIDER_XML comes from config.php
foreach($xml->provider as $provider){
if (isset($provider->name)) {
$pentry = $provider->name;
if ($with_url && isset($provider->url)) {
//$pentry = "<b>$pentry</b><br/>(" . $provider->url . ")";
$pentry = "$pentry";
}
$provider_names[] = $pentry;
}
}
natsort($provider_names);
return "<ol><li>" . implode("</li><li>", $provider_names) . "</li></ol>";
}
}