|
Revision 67
(checked in by hspath, 3 years ago)
|
- added "view source" link to example page template
- changed time:countdown christmas example to year 2005 (example3.xml)
- changed require/include statements to fit new directory structure
- moved inclusions to the files where there are needed
(e.g. "require 'patTemplate.php' was in /index.php, but patTemplate is used
in pat/patXMLRenderer.php)
- added page-level DocBlocks? where missing
- reformatted most code to come near PEAR Coding Standards
- fixed several E_NOTICEs
- merged some features from patSite
- optimized referer filtering for logging
- added function for creating directories recursively
- created /pat/patXMLRenderer/Extension
|
- Property 0 set to
- Property 1 set to
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
require_once 'config/patXMLRenderer.php'; |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
include_once $extDir.'/knownExtensions.php'; |
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
require_once 'pat/patErrorManager.php'; |
|---|
| 22 |
|
|---|
| 23 |
require_once 'pat/patTemplate.php'; |
|---|
| 24 |
require_once 'pat/patConfiguration.php'; |
|---|
| 25 |
|
|---|
| 26 |
require_once 'pat/patXMLPretty.php'; |
|---|
| 27 |
|
|---|
| 28 |
$file = isset( $_GET['file'] ) |
|---|
| 29 |
? $_GET['file'] |
|---|
| 30 |
: 'index.xml'; |
|---|
| 31 |
|
|---|
| 32 |
if ( !file_exists( $xmlDir.'/'.$file ) ) |
|---|
| 33 |
$file = '404.xml'; |
|---|
| 34 |
|
|---|
| 35 |
$tmpl = new patTemplate(); |
|---|
| 36 |
$tmpl->setBasedir( 'templates' ); |
|---|
| 37 |
$tmpl->readTemplatesFromFile( 'xmlPretty.tmpl' ); |
|---|
| 38 |
$tmpl->addGlobalVar( 'XMLSOURCE', $file ); |
|---|
| 39 |
|
|---|
| 40 |
$config = new patConfiguration; |
|---|
| 41 |
$config->setConfigDir( 'config' ); |
|---|
| 42 |
|
|---|
| 43 |
$pretty = new patXMLPretty; |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
$pretty->setExtensionDir( $extDir ); |
|---|
| 47 |
$pretty->setKnownExtensions( $knownExtensions ); |
|---|
| 48 |
|
|---|
| 49 |
$pretty->setTemplate( $tmpl ); |
|---|
| 50 |
$pretty->setConfiguration( $config ); |
|---|
| 51 |
|
|---|
| 52 |
$pretty->setXMLDir( $xmlDir ); |
|---|
| 53 |
$pretty->setXMLFile( $file ); |
|---|
| 54 |
|
|---|
| 55 |
$pretty->displayPretty(); |
|---|
| 56 |
?> |
|---|
| 57 |
|
|---|