Exemplo n.º 1
0
function dxray_create_graphml(&$aMenu, $file = 'sample_4.tgf')
{
    $j = $aMenu['id'];
    $GML = new GraphML();
    $ID = $GML->addNode($aMenu['title'], array($aMenu['file'], $aMenu['id'], $aMenu['description'], $aMenu['module'], $aMenu['tab_parent'], $aMenu['tab_root'], $aMenu['path']), array($aMenu['page calback'], $aMenu['access calback']));
    $RES = dxray_create_graphml_node($GML, $aMenu['child'], $ID);
    $dir = __DIR__;
    $file = __DIR__ . '/uml-' . date('d-m-Y_H-i-s') . '.graphml';
    $GML->createFullGraphML($file);
    $dbg = 'see array';
}
Exemplo n.º 2
0
/**
 *  Получить список VIEWS
 */
function dxray_get_views()
{
    $GML = new GraphML();
    $VIEWS = views_get_all_views();
    $nodeView = $GML->setOptionsNode()->Fill_setColor('#ccffff')->getOptions();
    $nodeDisplay = $GML->setOptionsNode()->Shape_setType('ellipse')->Fill_setColor('#ccffcc')->getOptions();
    $nodeDisplayPlug = $GML->setOptionsNode()->Shape_setType('parallelogram')->Fill_setColor('#33cccc')->getOptions();
    foreach ($VIEWS as $view) {
        //$id_view = $GML->addNodeShape($view->human_name);
        $v_data['attributes'] = array('Human name: ' . $view->human_name, 'Base_table: ' . $view->base_table, 'Base_field: ' . $view->base_field, 'Built: ' . dxray_convert_bool($view->built), 'Executed: ' . dxray_convert_bool($view->executed), 'Editing: ' . dxray_convert_bool($view->executed), 'Type: ' . $view->type);
        if ($view->attachment_before != '') {
            $v_data['attributes'][] = 'Attachment before: ' . $view->attachment_before;
            // string
        }
        if ($view->attachment_after != '') {
            $v_data['attributes'][] = 'Attachment after: ' . $view->attachment_after;
            // string
        }
        //$id_view = $GML->addNodeUMLClass($view->name, $v_data, $nodeView);
        $id_view = $GML->addNode($view->name, 'UMLClassNode', $nodeView, $v_data);
        $id_display = $GML->addNodeShape('Display', $nodeDisplay);
        $GML->addEdge($id_view, $id_display);
        $id_disp_plug_type = array();
        // name -> GML_ID
        foreach ($view->display as $display) {
            if (!isset($id_disp_plug_type[$display->display_plugin])) {
                $id_display_type = $GML->addNodeShape($display->display_plugin, $nodeDisplayPlug);
                $GML->addEdge($id_display, $id_display_type);
                $id_disp_plug_type[$display->display_plugin] = $id_display_type;
            } else {
                $id_display_type = $id_disp_plug_type[$display->display_plugin];
            }
            $data['attributes'] = array('ID: ' . $display->id, 'Display_Title: ' . $display->display_title, 'Display_plugin: ' . $display->display_plugin, 'DB table: ' . $display->db_table);
            if (isset($display->display_options['path'])) {
                $data['attributes'][] = 'Path: ' . $display->display_options['path'];
            }
            $id = $GML->addNodeUMLClass($display->display_title, $data);
            $GML->addEdge($id_display_type, $id);
        }
    }
    $dbg = 0;
    $file = DXRAY_OUTPATH . '/Views-' . date('d-m-Y_H-i-s') . '.graphml';
    $GML->createFullGraphML($file);
}
Exemplo n.º 3
0
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
/**
 * Root directory of Drupal installation.
 */
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
require_once './GraphML/gml/graphml.php';
$entity = entity_get_info();
$GML = new GraphML();
$NodeOpts = array('NodeFill' => array('color' => '#ffcc00'));
// Set Parametr rot Node who be entity
$NodeOpts['NodeLabel']['modelName'] = 'sides';
$NodeOpts['NodeLabel']['modelPosition'] = 'e';
$NodeOpts['NodeShape']['type'] = 'triangle';
$entity_id = $GML->addNode('Entity', 'ShapeNode', $NodeOpts);
unset($NodeOpts);
foreach ($entity as $key => $item) {
    $data = array();
    foreach ($item as $optname => $value) {
        $data['attributes'][] = $optname . ': ' . $value;
    }
    $aMethods = array();
    $NodeOpts['NodeFill']['color'] = '#ffaa55';
    $graph_id = $GML->addNode($item['label'], 'UMLClassNode', $NodeOpts, $data);
    $GML->addEdge($entity_id, $graph_id);
    if (isset($item['bundles'])) {
        $NodeOpts['NodeFill']['color'] = '#aaff55';
        $bundle_id = $GML->addNode('Bundles', 'ShapeNode', $NodeOpts);
        $GML->addEdge($graph_id, $bundle_id);
        sub_node_add($bundle_id, $GML, $item['bundles']);