From: Darren S. <ds...@us...> - 2005-08-17 17:23:45
|
Update of /cvsroot/xine/xine_www/data/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8664/data/php Modified Files: Tag: experimental2 readme.inc.php Log Message: Reorganise the README files: move the xine files and add a section for gxine. Indicate the default file in the XML for each section. Index: readme.inc.php =================================================================== RCS file: /cvsroot/xine/xine_www/data/php/Attic/readme.inc.php,v retrieving revision 1.1.2.1.2.5 retrieving revision 1.1.2.1.2.6 diff -u -r1.1.2.1.2.5 -r1.1.2.1.2.6 --- readme.inc.php 1 Aug 2005 23:56:52 -0000 1.1.2.1.2.5 +++ readme.inc.php 17 Aug 2005 17:23:36 -0000 1.1.2.1.2.6 @@ -1,31 +1,54 @@ <?php # $Id$ +if ($params[0] == '') +{ + $this->id = 'readme'; + $this->content = '<p>Nothing to see. You\'ve not selected a package - you +should select one from the main menu.</p>'; + return; +} + +$params[0] = substr ($params[0], 7); + $factory = new XML_Parser_Factory (); -$parser = $factory->get_Data_Parser ('readme_data'); -$security_data = $parser->parse(); +$parser = $factory->get_Data_Parser ('readme_' . $params[0]); + +if (!$parser) +{ + $this->id = 'readme' . ($text ? ' ' . $path : ''); + $this->content = $text ? reencode ($text->content, $text->meta->charset) + : ('<p>Sorry, I can\'t find anything for ' + . htmlspecialchars ($params[0]) . '.</p>'); + return; +} + +$data = $parser->parse(); $this->navigation .= ' <table class="makeMenu"><tr><td> <ul> <li><small>Readme List</small></li> '; -foreach ($security_data as $key => $value) +foreach ($data as $key => $value) $this->navigation .= '<li><small><a ' . generate_href ($key, 'documentation') . '>' . $value->id . "</a></small></li>\n"; $this->navigation .= ' </ul> </td></tr></table>'; -if ($params[0] == '') - $params[0] = 'README_en'; +if ($params[1] == '') + $params[1] = $parser->default; // Add basic README text { - $text = new Preformat_Parser ('data/readme/' . $params[0], "Readme", + $path = $params[0] . '/' . $params[1]; + $text = new Preformat_Parser ('data/readme/' . $path, "Readme", $parser->list[$params[0]], array_slice ($params, 1)); $this->text = htmlspecialchars ($params[0]); + $this->id = 'readme' . ($text ? ' ' . $path : ''); $this->content = $text ? reencode ($text->content, $text->meta->charset) - : ('<p>Sorry, I can\'t find ' . $this->text. '</p>'); + : ('<p>Sorry, I can\'t find ' . htmlspecialchars ($path) + . '.</p>'); } ?> |