function display_comp(Package $component, TableCreator $table_creator) { $string = ""; $component->with('classes'); foreach ($component->classes as $class) { $string .= display_class($class, $table_creator); } $component->with('packages'); $nested = $component->packages; foreach ($nested as $nuc) { $string .= display_comp($nuc, $table_creator); } return $string; }
function display_comp($component, TableCreator $table_creator) { $string = ''; $id = $component->full_name(); $name = $component->full_name("::\\-"); //$actors = implode(', ',$useCase->actors()); $string .= $table_creator->anchor($id, '') . "\n"; $string .= $table_creator->title(2, $name); $string .= $table_creator->title(3, "Informazioni sul package"); $string .= "\n \\begin{figure}[H]\n \\centering\n \\scalegraphics{img/package/{$component->name}}\n \\caption{Componente {$name}}\\label{fig:{$id}} \n \\end{figure}\n "; $string .= $table_creator->title(4, 'Descrizione'); $string .= $component->description . ". \n"; $component->with('packages'); $nested = $component->packages; if (count($nested) > 0) { $string .= $table_creator->title(4, 'Package contenuti'); $string .= $table_creator->begin_list(); foreach ($nested as $nuc) { $name = $nuc->full_name(); $string .= $table_creator->list_item($table_creator->link($name, $name)); } $string .= $table_creator->end_list(); } $allass = $component->get_dependencies(false); if (count($allass) > 0) { $skip = $component->all_descendant_id(); $alldep = array(); foreach ($allass as $dep) { if (!in_array($dep['id_from'], $skip)) { $alldep[] = $dep['id_from']; } else { if (!in_array($dep['id_to'], $skip)) { $alldep[] = $dep['id_to']; } } } if (count($alldep) > 0) { $string .= $table_creator->title(4, 'Interazioni con altri componenti'); $string .= $table_creator->begin_list(); foreach ($alldep as $d) { $nuc = Package::model()->findByPk($d); $name = $nuc->full_name(); $string .= $table_creator->list_item($table_creator->link($name, $name)); } $string .= $table_creator->end_list(); } } $component->with('classes'); if (count($component->classes) > 0) { $string .= $table_creator->title(3, 'Classi'); //$string .= $table_creator->begin_list(); foreach ($component->classes as $class) { /*$name = $class->full_name(); $string .= $table_creator->list_item( $table_creator->link($name,$name) );*/ $string .= display_class($class, $table_creator); } //$string .= $table_creator->end_list(); } foreach ($nested as $nuc) { $string .= display_comp($nuc, $table_creator); } return $string; }
<h3 class="box-title">Completed Class</h3> </div><!-- /.box-header --> <!-- form start --> <form class="form-horizontal" id="classsave" action="process_classcreate.php" method="post"> <div class="box-footer"> <button type="submit" name="classclear" class="btn btn-default">Cancel</button> <button type="submit" name="classsave" class="btn btn-info pull-right">Save</button> </div><!-- /.box-footer --> </form> </div> </div> <div class="col-md-6"> <?php display_class(); ?> </div><!-- /.box --> </div> </section><!-- /.content --> </div><!-- /.content-wrapper --> <footer class="main-footer"> <div class="pull-right hidden-xs"> <b>Version</b> 2.3.0 </div> <strong>Copyright © 2016 Yvonne Clarke 20046687.</strong> All rights reserved. </footer>
function display_package(Package $pack, $indentation, TableCreator $table_creator) { $txt = ""; /*$name = $pack->full_name("::"); if ( !$pack->virtual ) { $txt .= $table_creator->anchor($name,'')."\n"; $txt .= $table_creator->title(2,$name); $txt .= $pack->description."\n\n"; }*/ if ($indentation == 1) { $txt .= $table_creator->title(2, $pack->name); } //else if ( $indentation == 2 ) // $txt .= $table_creator->title(3,$pack->name); $pack->with('classes', 'packages'); foreach ($pack->classes as $c) { $txt .= display_class($c, $table_creator); } foreach ($pack->packages as $p) { $txt .= display_package($p, $indentation + 1, $table_creator); } return $txt; }
function display_comp($component, TableCreator $table_creator) { $string = ''; $id = $component->full_name(); $name = $component->full_name("::\\-"); $component->with('classes'); //$actors = implode(', ',$useCase->actors()); /*if ( !empty($component->classes) ) {*/ $string .= $table_creator->anchor($id, '') . "\n"; $string .= $table_creator->title(2, $name); $string .= "\n \\begin{figure}[H]\n \\centering\n \\scalegraphics{img/package/{$component->name}}\n \\caption{Componente {$name}}\\label{fig:{$id}} \n \\end{figure}\n "; //} $string .= $component->description . "\n "; foreach ($component->classes as $class) { $string .= display_class($class, $table_creator); } $component->with('packages'); $nested = $component->packages; foreach ($nested as $nuc) { $string .= display_comp($nuc, $table_creator); } return $string; }