1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <?php /* * display.git_opml.php * gitphp: A PHP git repository browser * Component: Display - OPML feed * * Copyright (C) 2008 Christopher Han <xiphux@gmail.com> */ require_once('util.script_url.php'); require_once('gitutil.git_read_projects.php'); function git_opml($projectroot,$projectlist) { global $tpl,$gitphp_conf; $projlist = git_read_projects($projectroot,$projectlist); header("Content-type: text/xml; charset=UTF-8"); $tpl->clear_all_assign(); $tpl->assign("title",$gitphp_conf['title']); $tpl->assign("self",script_url()); $opmllist = array(); foreach ($projlist as $cat => $plist) { if (is_array($plist)) { foreach ($plist as $i => $proj) { $opmllist[] = $proj; } } else { $opmllist[] = $plist; } } $tpl->assign("opmllist",$opmllist); $tpl->display("opml.tpl"); } ?> |