diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2008-11-13 09:39:03 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2008-11-13 09:39:03 +0000 |
| commit | 7c8979dded90784e749dd7b66ed3bc628c3bedb8 (patch) | |
| tree | 3a01d0a5105d054c799bfb0ff36d988e72ca14a8 /wiki_graph.php | |
| parent | 673e810b88c386b7a0b998eaf6b940d1c45ec732 (diff) | |
| download | wiki-7c8979dded90784e749dd7b66ed3bc628c3bedb8.tar.gz wiki-7c8979dded90784e749dd7b66ed3bc628c3bedb8.tar.bz2 wiki-7c8979dded90784e749dd7b66ed3bc628c3bedb8.zip | |
big cleanup of wiki, removed unused tables, removed commented code, moved remaining wikilib class stuff to BitPage (finally), revived and cleaned up wiki graph stuff, added generic methods to get default settings for graphs (still requires some UI to set all defaults)
Diffstat (limited to 'wiki_graph.php')
| -rw-r--r-- | wiki_graph.php | 57 |
1 files changed, 13 insertions, 44 deletions
diff --git a/wiki_graph.php b/wiki_graph.php index f15c6b0..f0dc51e 100644 --- a/wiki_graph.php +++ b/wiki_graph.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/wiki_graph.php,v 1.4 2007/06/01 16:01:30 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/wiki_graph.php,v 1.5 2008/11/13 09:39:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: wiki_graph.php,v 1.4 2007/06/01 16:01:30 squareing Exp $ + * $Id: wiki_graph.php,v 1.5 2008/11/13 09:39:03 squareing Exp $ * @package wiki * @subpackage functions */ @@ -17,49 +17,18 @@ * required setup */ include_once( '../bit_setup_inc.php' ); -include_once( UTIL_PKG_PATH.'GraphViz.php' ); include_once( WIKI_PKG_PATH.'BitPage.php'); -if(!isset($_REQUEST['level'])) $_REQUEST['level'] = 0; -if(!isset($_REQUEST['nodesep'])) $_REQUEST['nodesep'] = ".1"; -if(!isset($_REQUEST['rankdir'])) $_REQUEST['rankdir'] = "LR"; -if(!isset($_REQUEST['bgcolor'])) $_REQUEST['bgcolor'] = "transparent"; # general background color #rrvvbb or 'transparent' -if(!isset($_REQUEST['size'])) $_REQUEST['size'] = ""; # "x,y" in inches -if(!isset($_REQUEST['fontsize'])) $_REQUEST['fontsize'] = "9"; -if(!isset($_REQUEST['fontname'])) $_REQUEST['fontname'] = "Helvetica"; -if(!isset($_REQUEST['shape'])) $_REQUEST['shape'] = "box"; # plaintext ellipse circle egg triangle box diamond trapezium parallelogram house hexagon octagon -if(!isset($_REQUEST['nodestyle'])) $_REQUEST['nodestyle'] = "filled"; -if(!isset($_REQUEST['nodecolor'])) $_REQUEST['nodecolor'] = "#aeaeae"; -if(!isset($_REQUEST['nodefillcolor'])) $_REQUEST['nodefillcolor'] = "#FFFFFF"; -if(!isset($_REQUEST['nodewidth'])) $_REQUEST['nodewidth'] = ".1"; -if(!isset($_REQUEST['nodeheight'])) $_REQUEST['nodeheight'] = ".1"; -if(!isset($_REQUEST['edgecolor'])) $_REQUEST['edgecolor'] = "#999999"; -if(!isset($_REQUEST['edgestyle'])) $_REQUEST['edgestyle'] = "solid"; -$garg = array( - 'att' => array( - 'level' => $_REQUEST['level'], - 'nodesep' => $_REQUEST['nodesep'], - 'rankdir' => $_REQUEST['rankdir'], - 'bgcolor' => $_REQUEST['bgcolor'], - 'size' => $_REQUEST['size'] - ), - 'node' => array( - 'fontsize' => $_REQUEST['fontsize'], - 'fontname' => $_REQUEST['fontname'], - 'shape' => $_REQUEST['shape'], - 'style' => $_REQUEST['nodestyle'], - 'color' => $_REQUEST['nodecolor'], - 'fillcolor' => $_REQUEST['nodefillcolor'], - 'width' => $_REQUEST['nodewidth'], - 'height' => $_REQUEST['nodeheight'] - ), - 'edge' => array( - 'color' => $_REQUEST['edgecolor'], - 'style' => $_REQUEST['edgestyle'] - ) -); +include_once( WIKI_PKG_PATH.'lookup_page_inc.php'); +include_once( 'Image/GraphViz.php' ); $graph = new Image_GraphViz(); -$wikilib = new WikiLib(); -$str = $wikilib->wiki_get_link_structure($_REQUEST['page'], $_REQUEST['level']); -$wikilib->wiki_page_graph($str, $graph, $garg); + +$params = array( + 'graph' => $gBitThemes->getGraphvizGraphAttributes( $_REQUEST ), + 'node' => $gBitThemes->getGraphvizNodeAttributes( $_REQUEST ), + 'edge' => $gBitThemes->getGraphvizEdgeAttributes( $_REQUEST ), +); + +$linkStructure = $gContent->getLinkStructure( $gContent->mPageName, !empty( $_REQUEST['level'] ) ? $_REQUEST['level'] : 0 ); +$gContent->linkStructureGraph( $linkStructure, $params, $graph ); $graph->image( 'png' ); ?> |
