Skip to content

Commit

Permalink
Closes #831
Browse files Browse the repository at this point in the history
  • Loading branch information
justingit committed Jul 2, 2023
1 parent f9f82a5 commit 429d3b9
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 167 deletions.
29 changes: 18 additions & 11 deletions app/dada/DADA/App.pm
Expand Up @@ -10226,8 +10226,9 @@ sub edit_template {
my $header_content_tag_found_in_url_template = 0;
my $header_content_tag_found_in_default_template = 0;

my $content_tag = quotemeta('<!-- tmpl_var content -->');
my $header_content_tag = quotemeta('<!-- tmpl_var header_content -->');
my $content_tag = quotemeta('<!-- tmpl_var content -->');
my $header_content_tag = quotemeta('<!-- tmpl_var header_content -->');
my $header_content_include_tag = quotemeta('<!-- tmpl_include list_template_header_code_block.tmpl -->');

if ( $DADA::Config::TEMPLATE_OPTIONS->{user}->{enabled} == 1
&& $DADA::Config::TEMPLATE_OPTIONS->{user}->{mode} eq 'magic' )
Expand All @@ -10252,7 +10253,10 @@ sub edit_template {
if ( $raw_template =~ m/$content_tag/ ) {
$content_tag_found_in_default_template = 1;
}
if ( $raw_template =~ m/$header_content_tag/ ) {
if (
$raw_template =~ m/$header_content_tag/
|| $raw_template =~ m/$header_content_include_tag/
) {
$header_content_tag_found_in_default_template = 1;
}
}
Expand All @@ -10267,7 +10271,10 @@ sub edit_template {
$content_tag_found_in_template = 1;
}

if ( $edit_this_template =~ m/$header_content_tag/ ) {
if (
$edit_this_template =~ m/$header_content_tag/
|| $edit_this_template =~ m/$header_content_include_tag/
) {
$header_content_tag_found_in_template = 1;
}

Expand Down Expand Up @@ -10309,19 +10316,19 @@ sub edit_template {
$content_tag_found_in_url_template = 1;
}

if ( $tmp_tmpl =~ m/$header_content_tag/ ) {
if (
$tmp_tmpl =~ m/$header_content_tag/
|| $tmp_tmpl =~ m/$header_content_include_tag/
) {
$header_content_tag_found_in_url_template = 1;
}

}
else {

$template_url_check = 0;

}
}
}

my $scrn = DADA::Template::Widgets::wrap_screen(
{
-screen => 'edit_template_screen.tmpl',
Expand Down Expand Up @@ -10350,6 +10357,7 @@ sub edit_template {
$content_tag_found_in_url_template,
content_tag_found_in_default_template =>
$content_tag_found_in_default_template,
header_content_tag_found_in_default_template => $header_content_tag_found_in_default_template,

header_content_tag_found_in_template => $header_content_tag_found_in_template,
header_content_tag_found_in_url_template => $header_content_tag_found_in_url_template,
Expand Down Expand Up @@ -16451,14 +16459,13 @@ sub transform_to_pro {
open my $config, '>>', $config_file or die $!;
print $config $config_chunk or die $!;
close $config or die;
}
catch {
} catch {
$status = 0;
$error = $_;
warn $_;
};

if ( $status == 1 ) {

$c->flush;
$self->header_type('redirect');
$self->header_props( -url => $DADA::Config::S_PROGRAM_URL
Expand Down
1 change: 1 addition & 0 deletions app/dada/DADA/Config.pm
Expand Up @@ -554,6 +554,7 @@ $DEBUG_TRACE //= {
DADA_App_HTMLtoMIMEMessage => 0,
DADA_App_Subscriptions => 0,
DADA_App_WebServices => 0,
DADA_Template_HTML => 0,
DADA_Logging_Clickthrough => 0,
DADA_Mail_MailOut => 0,
DADA_Mail_Send => 0,
Expand Down

0 comments on commit 429d3b9

Please sign in to comment.