additional_plugins/serendipity_event_oembed/oembed/ProviderList.php
Garvin Hicking 10406043d9 Fixes #429
2017-04-09 09:21:48 +02:00

19 lines
762 B
PHP

<?php
class ProviderList {
static function ul_providernames($with_url=false) {
$provider_names = array();
$xml = simplexml_load_file(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>";
}
}