Skip to content

Commit

Permalink
#9
Browse files Browse the repository at this point in the history
  • Loading branch information
sazanof authored Sep 11, 2017
1 parent 72ecf31 commit b8540da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions assets/modules/letters/snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
$formname = isset($formname) ? $formname : 'lForm';
$cat_id = isset($cat_id) ? $cat_id : '';
$type = isset($type) ? $type : 'subscribe';
$wrapTpl= isset($wrapTpl) ? $wrapTpl : '<div id="[+formname+]">[+form+]</div>';
$tpl = isset($tpl) ? $modx->getChunk($tpl) : '
<div id="[+formname+]">
[+msg+]
<form action="[~[*id*]~]?type=subscribe" method="post" name="[+formname+]" onsubmit="submitAjax_[+formname+]();return false;">
<input type="hidden" name="token" value="[+token+]">
Expand All @@ -55,7 +55,7 @@
<input type="email" name="email" class="form-control" placeholder="Адрес email" value="[+email+]">
</div>
<button type="submit" name="sub" value="1" class="btn btn-success">Отправить</button>
</form></div>';
</form>';

$tpl_unsubscribe = isset($tpl_unsubscribe) ? $tpl_unsubscribe : '
<form method="post" action="[~[*id*]~]?type=unsubscribe">
Expand Down Expand Up @@ -143,14 +143,14 @@ function submitAjax_[+formname+](){
//добавляем подписчика
$data['cat_id'] = $cat_id;
if ($subscribers->InsOrUpdSubscriber($data, 'NULL') === true) {
$msg = $thankyouTpl;
$tpl = $thankyouTpl;
}
unset($_SESSION['token']);
}
}
}
else {
$msg .= $lang['error'];
$msg.= $lang['error'];
}

}
Expand Down Expand Up @@ -222,8 +222,8 @@ function submitAjax_[+formname+](){
$data['email'],
$msg
);

$out .= $tpl;
$wrapTpl = str_replace('[+form+]',$tpl,$wrapTpl);
$out .= $wrapTpl;
$out = str_replace($f, $r, $out);
} else {
$out = "Не найден языковой файл! Проверьте конфинурацию модуля и файлы.";
Expand Down

0 comments on commit b8540da

Please sign in to comment.