/** * Получить список 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); }
$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']); } if (isset($item['view modes'])) { $NodeOpts['NodeFill']['color'] = '#ff00ff'; $view_id = $GML->addNode('View modes', 'ShapeNode', $NodeOpts); $GML->addEdge($graph_id, $view_id); sub_node_add($view_id, $GML, $item['view modes']); } //$item['bundles'] //$item['view modes'] (oy key) }