[Bio] / SubsystemEditor / WebPage / ShowIllustrations.pm Repository:
ViewVC logotype

Diff of /SubsystemEditor/WebPage/ShowIllustrations.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Mon Apr 7 21:03:50 2008 UTC revision 1.5, Mon May 5 19:34:28 2008 UTC
# Line 46  Line 46 
46    my $ssname = $name;    my $ssname = $name;
47    $ssname =~ s/\_/ /g;    $ssname =~ s/\_/ /g;
48    
49      my $esc_name = uri_escape($name);
50    
51    my $subsystem = new Subsystem( $name, $fig, 0 );    my $subsystem = new Subsystem( $name, $fig, 0 );
52    
53    # look if someone is logged in and can write the subsystem #    # look if someone is logged in and can write the subsystem #
# Line 62  Line 64 
64    my $menu = $self->application->menu();    my $menu = $self->application->menu();
65    
66    # Build nice tab menu here    # Build nice tab menu here
67    $menu->add_category( 'Subsystem Info', "SubsysEditor.cgi?page=ShowSubsystem&subsystem=$name" );    $menu->add_category( 'Subsystem Info', "SubsysEditor.cgi?page=ShowSubsystem&subsystem=$esc_name" );
68    $menu->add_category( 'Functional Roles', "SubsysEditor.cgi?page=ShowFunctionalRoles&subsystem=$name" );    $menu->add_category( 'Functional Roles', "SubsysEditor.cgi?page=ShowFunctionalRoles&subsystem=$esc_name" );
69    $menu->add_category( 'Diagram', "SubsysEditor.cgi?page=ShowDiagram&subsystem=$name" );    $menu->add_category( 'Diagram', "SubsysEditor.cgi?page=ShowDiagram&subsystem=$esc_name" );
70    $menu->add_category( 'Illustrations', "SubsysEditor.cgi?page=ShowIllustrations&subsystem=$name" );    $menu->add_category( 'Illustrations', "SubsysEditor.cgi?page=ShowIllustrations&subsystem=$esc_name" );
71    $menu->add_category( 'Spreadsheet', "SubsysEditor.cgi?page=ShowSpreadsheet&subsystem=$name" );    $menu->add_category( 'Spreadsheet', "SubsysEditor.cgi?page=ShowSpreadsheet&subsystem=$esc_name" );
72    $menu->add_category( 'Show Check', "SubsysEditor.cgi?page=ShowCheck&subsystem=$name" );    $menu->add_category( 'Show Check', "SubsysEditor.cgi?page=ShowCheck&subsystem=$esc_name" );
73    $menu->add_category( 'Show Connections', "SubsysEditor.cgi?page=ShowTree&subsystem=$name" );    $menu->add_category( 'Show Connections', "SubsysEditor.cgi?page=ShowTree&subsystem=$esc_name" );
74    
75    my $error = '';    my $error = '';
76    my $comment = '';    my $comment = '';
# Line 145  Line 147 
147      $subsystem_pretty =~ s/_/ /g;      $subsystem_pretty =~ s/_/ /g;
148      my ( $subsystem, $newDiagrams, $defaultDiagram ) = get_data( $fig, $subsystem_name );      my ( $subsystem, $newDiagrams, $defaultDiagram ) = get_data( $fig, $subsystem_name );
149    
150        my $esc_name = uri_escape($subsystem_name);
151    
152      # check subsystem      # check subsystem
153      unless ( $subsystem ) {      unless ( $subsystem ) {
154        return "<p>Unable to find a subsystem called '$subsystem_name'.</p>";        return "<p>Unable to find a subsystem called '$subsystem_name'.</p>";
# Line 232  Line 236 
236        }        }
237        else {        else {
238          $scaling_info .= '<p><em>This diagram has been scaled to '.$scale.'%. ';          $scaling_info .= '<p><em>This diagram has been scaled to '.$scale.'%. ';
239          $scaling_info .= "(<a href='".$self->application->url()."?page=ShowDiagram&subsystem=$subsystem_name&diagram=$diagram_id&dont_scale=1'>".          $scaling_info .= "(<a href='".$self->application->url()."?page=ShowIllustrations&subsystem=$esc_name&diagram=$diagram_id&dont_scale=1'>".
240            "view in original size</a>)";            "view in original size</a>)";
241          $scaling_info .= '</em></p>';          $scaling_info .= '</em></p>';
242        }        }
243        if ( $cgi->param( 'dont_scale' ) ) {        if ( $cgi->param( 'dont_scale' ) ) {
244          $scaling_info .= '<p><em>You have switched off scaling this diagram down. ';          $scaling_info .= '<p><em>You have switched off scaling this diagram down. ';
245          $scaling_info .= "(<a href='".$self->application->url()."?page=ShowDiagram&subsystem=$subsystem_name&diagram=$diagram_id'>".          $scaling_info .= "(<a href='".$self->application->url()."?page=ShowIllustrations&subsystem=$esc_name&diagram=$diagram_id'>".
246            "Allow scaling</a>)";            "Allow scaling</a>)";
247          $scaling_info .= '</em></p>';          $scaling_info .= '</em></p>';
248        }        }
# Line 250  Line 254 
254    
255      # upload diagram only if can_alter #      # upload diagram only if can_alter #
256      if ( $can_alter ) {      if ( $can_alter ) {
257        my $upload = $self->build_upload_diagram( $fig, $subsystem_name );        my $upload = $self->build_upload_diagram( $fig, $esc_name );
258        $content .= "$upload";        $content .= "$upload";
259    
260        my $delete = '';        my $delete = '';
261        if ( defined( $diagram_id ) ) {        if ( defined( $diagram_id ) ) {
262          $delete = $self->build_delete_diagram( $fig, $subsystem_name, $diagram_id );          $delete = $self->build_delete_diagram( $fig, $esc_name, $diagram_id );
263          $content .= "$delete";          $content .= "$delete";
264        }        }
265      }      }
# Line 264  Line 268 
268    
269      # hiddens for subsystem, diagram, scale #      # hiddens for subsystem, diagram, scale #
270      $content .= $cgi->hidden( -name  => 'subsystem',      $content .= $cgi->hidden( -name  => 'subsystem',
271                                -value => $subsystem_name );                                -value => $esc_name );
272      $content .= $cgi->hidden( -name  => 'diagram',      $content .= $cgi->hidden( -name  => 'diagram',
273                                -value => $diagram_id );                                -value => $diagram_id );
274    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3