|
@@ -162,6 +162,13 @@ our %routes = (
|
|
|
noindex => 1,
|
|
noindex => 1,
|
|
|
nocache => 1,
|
|
nocache => 1,
|
|
|
},
|
|
},
|
|
|
|
|
+ '/admin/wyzzerdd' => {
|
|
|
|
|
+ method => 'GET',
|
|
|
|
|
+ auth => 1,
|
|
|
|
|
+ callback => \&Trog::Routes::HTML::post_wizard,
|
|
|
|
|
+ noindex => 1,
|
|
|
|
|
+ nocache => 1,
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
#TODO transform into posts?
|
|
#TODO transform into posts?
|
|
|
'/sitemap',
|
|
'/sitemap',
|
|
@@ -1719,6 +1726,28 @@ sub sessions ($query) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+sub post_wizard ($query) {
|
|
|
|
|
+ return $query->{tpsgi}->see_also('/login') unless $query->{user};
|
|
|
|
|
+ return $query->{tpsgi}->forbidden($query) unless grep { $_ eq 'admin' } @{ $query->{user_acls} };
|
|
|
|
|
+
|
|
|
|
|
+ # Get the existing post types
|
|
|
|
|
+ my $forms = Trog::Themes::templates_in_dir( "forms", 'text/html', 1 );
|
|
|
|
|
+
|
|
|
|
|
+ return Trog::Routes::HTML::index(
|
|
|
|
|
+ {
|
|
|
|
|
+ title => 'tCMS Post Wizard',
|
|
|
|
|
+ theme_dir => Trog::Themes::td(),
|
|
|
|
|
+ template => 'post_wizard.tx',
|
|
|
|
|
+ is_admin => 1,
|
|
|
|
|
+ forms => $forms,
|
|
|
|
|
+ %$query,
|
|
|
|
|
+ },
|
|
|
|
|
+ undef,
|
|
|
|
|
+ ['post.css'],
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
# basically a file rewrite rule for themes
|
|
# basically a file rewrite rule for themes
|
|
|
sub icon ($query) {
|
|
sub icon ($query) {
|
|
|
my $path = $query->{route};
|
|
my $path = $query->{route};
|