[Codestriker-commits] CVS update: codestriker/lib/Codestriker/Http UrlBuilder.pm
Brought to you by:
sits
|
From: <si...@us...> - 2006-06-11 08:49:43
|
User: sits Date: 06/06/11 01:49:42 Modified: lib/Codestriker/Http UrlBuilder.pm Log: I can't remember our reasoning for making our CGI & -> & perhaps something to do with an html lint program complaining? In any case, it does seem unnecessary, and produces ugly URLs, as indicated by a user at: http://sourceforge.net/tracker/index.php?func=detail&aid=1460144&group_id=41136&atid=429860 If there is a valid reason, let me know and we can revert it. Index: UrlBuilder.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- UrlBuilder.pm 24 Jan 2006 23:53:03 -0000 1.28 +++ UrlBuilder.pm 11 Jun 2006 08:49:42 -0000 1.29 @@ -55,13 +55,13 @@ $updated, $brmode, $fview) = @_; return ($prefix ne "" ? $prefix : $self->{query}->url()) . - "?topic=$topic&action=view" . + "?topic=$topic&action=view" . ($updated ? "&updated=$updated" : "") . - ((defined $tabwidth && $tabwidth ne "") ? "&tabwidth=$tabwidth" : "") . - ((defined $mode && $mode ne "") ? "&mode=$mode" : "") . - ((defined $brmode && $brmode ne "") ? "&brmode=$brmode" : "") . - ((defined $fview && $fview ne "") ? "&fview=$fview" : "") . - ((defined $email && $email ne "") ? "&email=$email" : "") . + ((defined $tabwidth && $tabwidth ne "") ? "&tabwidth=$tabwidth" : "") . + ((defined $mode && $mode ne "") ? "&mode=$mode" : "") . + ((defined $brmode && $brmode ne "") ? "&brmode=$brmode" : "") . + ((defined $fview && $fview ne "") ? "&fview=$fview" : "") . + ((defined $email && $email ne "") ? "&email=$email" : "") . ($line != -1 ? "#${line}" : ""); } @@ -78,14 +78,14 @@ # Create the URL for downloading the topic text. sub download_url ($$) { my ($self, $topic) = @_; - return $self->{query}->url() . "?action=download&topic=$topic"; + return $self->{query}->url() . "?action=download&topic=$topic"; } # Create the URL for creating a topic. sub create_topic_url ($$) { my ($self, $obsoletes) = @_; return $self->{query}->url() . "?action=create" . - (defined $obsoletes ? "&obsoletes=$obsoletes" : ""); + (defined $obsoletes ? "&obsoletes=$obsoletes" : ""); } # Create the URL for editing a topic. @@ -93,17 +93,17 @@ my ($self, $filenumber, $line, $new, $topic, $context, $anchor, $prefix) = @_; return ($prefix ne "" ? $prefix : $self->{url_prefix}) . - "?fn=$filenumber&line=$line&new=$new&topic=$topic&action=edit" . - ((defined $anchor && $anchor ne "") ? "&a=$anchor" : "") . - ((defined $context && $context ne "") ? "&context=$context" : ""); + "?fn=$filenumber&line=$line&new=$new&topic=$topic&action=edit" . + ((defined $anchor && $anchor ne "") ? "&a=$anchor" : "") . + ((defined $context && $context ne "") ? "&context=$context" : ""); } # Create the URL for viewing a new file. sub view_file_url ($$$$$$$) { my ($self, $topic, $filenumber, $new, $line, $mode, $parallel) = @_; if (!(defined $mode)) { $mode = $Codestriker::default_topic_create_mode; } - return $self->{url_prefix} . "?action=view_file&fn=$filenumber&" . - "topic=$topic&new=$new&mode=$mode&parallel=$parallel#$filenumber|$line|$new"; + return $self->{url_prefix} . "?action=view_file&fn=$filenumber&" . + "topic=$topic&new=$new&mode=$mode¶llel=$parallel#$filenumber|$line|$new"; } # Create the URL for the search page. @@ -148,19 +148,19 @@ my $sproject = defined $project_array_ref ? (join ',', @$project_array_ref) : ""; return $self->{query}->url() . "?action=$action" . - ($sauthor ne "" ? "&sauthor=$sauthor" : "") . - ($sreviewer ne "" ? "&sreviewer=$sreviewer" : "") . - ($scc ne "" ? "&scc=$scc" : "") . - ($sbugid ne "" ? "&sbugid=$sbugid" : "") . - ($stext ne "" ? "&stext=" . CGI::escape($stext) : "") . - ($stitle ne "" ? "&stitle=$stitle" : "") . - ($sdescription ne "" ? "&sdescription=$sdescription" : "") . - ($scomments ne "" ? "&scomments=$scomments" : "") . - ($sbody ne "" ? "&sbody=$sbody" : "") . - ($sfilename ne "" ? "&sfilename=$sfilename" : "") . - ($sstate ne "" ? "&sstate=$sstate" : "") . - ($sproject ne "" ? "&sproject=$sproject" : "") . - (defined $content && $content ne "" ? "&content=$content" : ""); + ($sauthor ne "" ? "&sauthor=$sauthor" : "") . + ($sreviewer ne "" ? "&sreviewer=$sreviewer" : "") . + ($scc ne "" ? "&scc=$scc" : "") . + ($sbugid ne "" ? "&sbugid=$sbugid" : "") . + ($stext ne "" ? "&stext=" . CGI::escape($stext) : "") . + ($stitle ne "" ? "&stitle=$stitle" : "") . + ($sdescription ne "" ? "&sdescription=$sdescription" : "") . + ($scomments ne "" ? "&scomments=$scomments" : "") . + ($sbody ne "" ? "&sbody=$sbody" : "") . + ($sfilename ne "" ? "&sfilename=$sfilename" : "") . + ($sstate ne "" ? "&sstate=$sstate" : "") . + ($sproject ne "" ? "&sproject=$sproject" : "") . + (defined $content && $content ne "" ? "&content=$content" : ""); } @@ -168,7 +168,7 @@ sub edit_project_url ($$) { my ($self, $projectid) = @_; - return $self->{query}->url() . "?action=edit_project&projectid=$projectid"; + return $self->{query}->url() . "?action=edit_project&projectid=$projectid"; } # Construct a URL for listing all projects. @@ -189,7 +189,7 @@ sub view_comments_url ($$) { my ($self, $topic) = @_; - return $self->{query}->url() . "?action=list_comments&topic=$topic"; + return $self->{query}->url() . "?action=list_comments&topic=$topic"; } # Create the URL for viewing the topic properties. @@ -197,14 +197,14 @@ my ($self, $topic) = @_; return $self->{query}->url() . - "?action=view_topic_properties&topic=$topic"; + "?action=view_topic_properties&topic=$topic"; } # Create the URL for viewing the topic metrics. sub view_topicinfo_url ($$) { my ($self, $topic) = @_; - return $self->{query}->url() . "?action=viewinfo&topic=$topic"; + return $self->{query}->url() . "?action=viewinfo&topic=$topic"; } sub metric_report_url { |