use Date::Calc qw/Date_to_Days Today/;
use Koha::DateUtils;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my $id = $cgi->param('id');
my $title = $cgi->param('title');
my $lang = $cgi->param('lang');
my $branchcode = $cgi->param('branch');
my $error_message = $cgi->param('error_message');
+my $wysiwyg;
+if( $cgi->param('editmode') ){
+ $wysiwyg = $cgi->param('editmode') eq "wysiwyg" ? 1 : 0;
+} else {
+ $wysiwyg = C4::Context->preference("NewsToolEditor") eq "tinymce" ? 1 : 0;
+}
# Foreign Key constraints work with NULL, not ''
# NULL = All branches.
template_name => "tools/koha-news.tt",
query => $cgi,
type => "intranet",
- authnotrequired => 0,
flagsrequired => { tools => 'edit_news' },
debug => 1,
}
opac_news_count => $opac_news_count,
);
}
-$template->param( lang => $lang );
+$template->param(
+ lang => $lang,
+ wysiwyg => $wysiwyg,
+);
output_html_with_http_headers $cgi, $cookie, $template->output;