diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2009-03-14 07:27:32 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2009-03-14 07:27:32 +0000 |
| commit | 6a451891908ec2a0be911fe35bc61ea6c3237840 (patch) | |
| tree | 51b38967e0ed8dfadba9f10ef5e0e82c53f63e43 /BitThemes.php | |
| parent | 9d9f927b5382312dc3a8f92351955c613ddeb3b6 (diff) | |
| download | themes-6a451891908ec2a0be911fe35bc61ea6c3237840.tar.gz themes-6a451891908ec2a0be911fe35bc61ea6c3237840.tar.bz2 themes-6a451891908ec2a0be911fe35bc61ea6c3237840.zip | |
clean up output from graphviz methods
Diffstat (limited to 'BitThemes.php')
| -rw-r--r-- | BitThemes.php | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/BitThemes.php b/BitThemes.php index 68fe8a4..97202e9 100644 --- a/BitThemes.php +++ b/BitThemes.php @@ -1,7 +1,7 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_themes/BitThemes.php,v 1.94 2009/02/06 11:55:57 squareing Exp $ - * @version $Revision: 1.94 $ + * @version $Header: /cvsroot/bitweaver/_bit_themes/BitThemes.php,v 1.95 2009/03/14 07:27:32 squareing Exp $ + * @version $Revision: 1.95 $ * @package themes */ @@ -1711,26 +1711,26 @@ class BitThemes extends BitBase { */ function getGraphvizGraphAttributes( $pParams = array() ) { global $gBitSystem; - foreach( $pParams as $key => $value ) { - // any parameter can be prefixed that they can be passed in all at once - if( empty( $value ) || preg_match( "@^(edge|node)@", $key )) { - unset( $pParams[$key] ); - } else { - $pParams[preg_replace( '@^graph@', '', $key )] = $value; - } - } - $ret = array( 'bgcolor' => $gBitSystem->getConfig( 'graphviz_graph_bgcolor', 'transparent' ), - 'color' => $gBitSystem->getConfig( 'graphviz_node_color', 'black' ), + 'color' => $gBitSystem->getConfig( 'graphviz_graph_color', '#000000' ), 'fontname' => $gBitSystem->getConfig( 'graphviz_graph_fontname', 'Helvetica' ), 'fontsize' => $gBitSystem->getConfig( 'graphviz_graph_fontsize', 10 ), 'nodesep' => $gBitSystem->getConfig( 'graphviz_graph_nodesep', '.1' ), 'overlap' => $gBitSystem->getConfig( 'graphviz_graph_overlap', 'scale' ), 'rankdir' => $gBitSystem->getConfig( 'graphviz_graph_rankdir', 'LR' ), - 'size' => $gBitSystem->getConfig( 'graphviz_graph_size' ), + 'size' => '', ); - return( array_merge( $ret, $pParams )); + + foreach( $pParams as $key => $value ) { + // any parameter can be prefixed that they can be passed in all at once + if( empty( $value ) || preg_match( "@^(edge_|node_)@", $key )) { + unset( $pParams[$key] ); + } elseif( isset( $ret[preg_replace( '@^graph_@', '', $key )] )) { + $ret[preg_replace( '@^graph_@', '', $key )] = $value; + } + } + return $ret; } /** @@ -1742,16 +1742,6 @@ class BitThemes extends BitBase { */ function getGraphvizNodeAttributes( $pParams = array() ) { global $gBitSystem; - foreach( $pParams as $key => $value ) { - // any parameter can be prefixed that they can be passed in all at once - if( empty( $value ) || preg_match( "@^(edge|graph)@", $key )) { - unset( $pParams[$key] ); - } else { - $pParams[preg_replace( '@^node@', '', $key )] = $value; - unset( $pParams[$key] ); - } - } - $ret = array( 'color' => $gBitSystem->getConfig( 'graphviz_node_color', '#aaaaaa' ), 'fillcolor' => $gBitSystem->getConfig( 'graphviz_node_fillcolor', 'white' ), @@ -1764,7 +1754,16 @@ class BitThemes extends BitBase { 'style' => $gBitSystem->getConfig( 'graphviz_node_style', 'rounded,filled' ), 'width' => $gBitSystem->getConfig( 'graphviz_node_width', '.1' ), ); - return( array_merge( $ret, $pParams )); + + foreach( $pParams as $key => $value ) { + // any parameter can be prefixed that they can be passed in all at once + if( empty( $value ) || preg_match( "@^(edge_|graph_)@", $key )) { + unset( $pParams[$key] ); + } elseif( isset( $ret[preg_replace( '@^node_@', '', $key )] )) { + $ret[preg_replace( '@^node_@', '', $key )] = $value; + } + } + return $ret; } /** @@ -1776,25 +1775,25 @@ class BitThemes extends BitBase { */ function getGraphvizEdgeAttributes( $pParams = array() ) { global $gBitSystem; - foreach( $pParams as $key => $value ) { - // any parameter can be prefixed that they can be passed in all at once - if( empty( $value ) || preg_match( "@^(node|graph)@", $key )) { - unset( $pParams[$key] ); - } else { - $pParams[preg_replace( '@^edge@', '', $key )] = $value; - } - } - $ret = array( 'color' => $gBitSystem->getConfig( 'graphviz_edge_color', '#888888' ), - 'dir' => $gBitSystem->getConfig( 'graphviz_edge_dir' ), 'fontcolor' => $gBitSystem->getConfig( 'graphviz_edge_fontcolor', 'black' ), 'fontname' => $gBitSystem->getConfig( 'graphviz_edge_fontname', 'Helvetica' ), 'fontsize' => $gBitSystem->getConfig( 'graphviz_edge_fontsize', 10 ), - 'label' => $gBitSystem->getConfig( 'graphviz_edge_label' ), 'style' => $gBitSystem->getConfig( 'graphviz_edge_style', 'solid' ), + 'dir' => '', + 'label' => '', ); - return( array_merge( $ret, $pParams )); + + foreach( $pParams as $key => $value ) { + // any parameter can be prefixed that they can be passed in all at once + if( empty( $value ) || preg_match( "@^(node_|graph_)@", $key )) { + unset( $pParams[$key] ); + } elseif( isset( $ret[preg_replace( '@^edge_@', '', $key )] )) { + $ret[preg_replace( '@^edge_@', '', $key )] = $value; + } + } + return $ret; } |
