admin links are now synthesized links to admin.pl
authorTony Cook <tony@develop-help.com>
Wed, 7 Mar 2012 03:04:47 +0000 (14:04 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 7 Mar 2012 03:04:47 +0000 (14:04 +1100)
even if it says something else in the admin column of the article

Changes.txt
site/cgi-bin/modules/Article.pm
site/cgi-bin/modules/BSE/Formatter.pm

index 1b3f8fde50b9fefc8a89c1e4f587ab55df45404b..14de3aa1e0fb9a8d3faf5a73b829c365336f3674 100644 (file)
@@ -60,6 +60,10 @@ BSE 0.21 - unreleased
    The bse_make_index background process now uses the console version.
    https://rt4.develop-help.com/Ticket/Display.html?id=1301
 
+ - admin-mode article links now ignore the admin value stored in the
+   article record and always return a link to admin.pl for that
+   article.
+
 Bug fixes:
 
  - thumb.pl would return content types with doubled image/ prefixes,
index 07ca17f4584c5b72bab005eacfcb55ac85683312..ce623223df8e82a9d07ce287e27ed415d6666cea 100644 (file)
@@ -8,7 +8,7 @@ use vars qw/@ISA/;
 @ISA = qw/Squirrel::Row BSE::TB::SiteCommon BSE::TB::TagOwner/;
 use Carp 'confess';
 
-our $VERSION = "1.010";
+our $VERSION = "1.011";
 
 sub columns {
   return qw/id parentid displayOrder title titleImage body
@@ -307,6 +307,12 @@ sub link {
   return $link;
 }
 
+sub admin {
+  my ($self) = @_;
+
+  return BSE::Cfg->single->admin_url("admin", { id => $self->id });
+}
+
 sub is_linked {
   my ($self) = @_;
 
index 8bda1db71c73091d69610a4dd53e7897324e2281..328941d2f1af11ee2d607793b0b3a1ce3cfefd21 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use BSE::Util::HTML;
 use Carp 'confess';
 
-our $VERSION = "1.001";
+our $VERSION = "1.002";
 
 use base 'DevHelp::Formatter';
 
@@ -184,7 +184,7 @@ sub doclink {
   my $admin = $self->{gen}{admin_links};
   my $url;
   if ($admin) {
-    $url = $art->{admin};
+    $url = $art->admin;
     if (!$self->{gen}{admin}) {
       $url .= $url =~ /\?/ ? "&" : "?";
       $url .= "admin=0&admin_links=1";