|
Revision 2, 1.0 kB
(checked in by argh, 3 years ago)
|
Initial project checkin.
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
class patXMLPretty_ConfigReader_patConfiguration extends patXMLPretty_ConfigReader |
|---|
| 4 |
{ |
|---|
| 5 |
function read() |
|---|
| 6 |
{ |
|---|
| 7 |
|
|---|
| 8 |
$conf =& new patConfiguration(); |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
$success = $conf->parseConfigFile( dirname( __FILE__ ).'/patConfiguration.xml' ); |
|---|
| 12 |
if( patErrorManager::isError( $success ) ) { |
|---|
| 13 |
return $success; |
|---|
| 14 |
} |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
$success = $conf->parseConfigFile( $this->options['syntaxFile'] ); |
|---|
| 18 |
if( patErrorManager::isError( $success ) ) { |
|---|
| 19 |
return $success; |
|---|
| 20 |
} |
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
$values = $conf->getConfigValue(); |
|---|
| 24 |
foreach( $values['syntax'] as $confName => $confValue ) { |
|---|
| 25 |
if( $confName == 'colors' || $confName == 'tagColors' ) { |
|---|
| 26 |
$colors = array(); |
|---|
| 27 |
foreach( $confValue as $color ) { |
|---|
| 28 |
$colors[$color['id']] = $color['value']; |
|---|
| 29 |
} |
|---|
| 30 |
|
|---|
| 31 |
$confValue = $colors; |
|---|
| 32 |
} |
|---|
| 33 |
|
|---|
| 34 |
$this->$confName = $confValue; |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
$result = true; |
|---|
| 38 |
return $result; |
|---|
| 39 |
} |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
?> |
|---|