} if ($_POST['comments_allow'] <= 0) { $ca_y = ''; $ca_n = 'checked="checked"'; } if ($_POST['published'] < 0) { $p_y = ''; $p_n = 'checked="checked"'; } if (isset($_POST['now'])) { $date_disabled = 'disabled="disabled"'; $date_now = 'checked="checked"'; } } else { $current_cat_id = array(1); $ft->assign('NOTE_PREVIEW', false); } $ft->define('form_noteadd', 'form_noteadd.tpl'); $ft->assign(array('ONLY_IN_CAT_Y' => $oic_y, 'ONLY_IN_CAT_N' => $oic_n, 'COMMENTS_ALLOW_Y' => $ca_y, 'COMMENTS_ALLOW_N' => $ca_n, 'PUBLISHED_Y' => $p_y, 'PUBLISHED_N' => $p_n, 'DATE' => $date, 'AUTHOR' => isset($_POST['author']) ? str_entit($_POST['author']) : $_SESSION['login'], 'DATE_DISABLED' => $date_disabled, 'DATE_NOW' => $date_now)); unset($oic_y, $oic_n, $ca_y, $ca_n, $p_y, $p_n); //wyswietlamy jakis komunikat ? if (isset($_GET['msg']) && is_numeric($_GET['msg'])) { $monit[] = $i18n['add_note'][$_GET['msg']]; } if (count($monit)) { tpl_message($monit); } //lista kategorii $cats = db_get_categories(); tpl_categories('CATEGORIES', $cats, 0, $current_cat_id); $ft->parse('ROWS', '.form_noteadd');
$p_y = 'checked="checked"'; $p_n = ''; $date_now = ''; $date_disabled = ''; if (!$news->get_only_in_category()) { $oic_y = ''; $oic_n = 'checked="checked"'; } if (!$news->get_comments_allow()) { $ca_y = ''; $ca_n = 'checked="checked"'; } if (!$news->get_published()) { $p_y = ''; $p_n = 'checked="checked"'; } if (isset($_POST['now'])) { $date_now = 'checked="checked"'; $date_disabled = 'disabled="disabled"'; } $ft->define(array('form_noteedit' => 'form_noteedit.tpl')); $ft->assign(array('AUTHOR' => $news->get_author(), 'DATE' => sprintf('%s %s', $news->get_date(), $news->get_time()), 'ID' => $news->get_id(), 'TITLE' => $news->get_title(), 'TEXT' => $news->get_text(), 'ONLY_IN_CAT_YES' => $oic_y, 'ONLY_IN_CAT_NO' => $oic_n, 'COMMENTS_ALLOW_YES' => $ca_y, 'COMMENTS_ALLOW_NO' => $ca_n, 'PUBLISHED_YES' => $p_y, 'PUBLISHED_NO' => $p_n, 'DATE_NOW' => $date_now, 'DATE_DISABLED' => $date_disabled)); unset($oic_y, $oic_n, $ca_y, $ca_n, $p_y, $p_n); //lista kategorii $cats = db_get_categories(); tpl_categories('CATEGORIES', $cats, 0, $news->get_id_cat()); //ewentualny message if (count($monit)) { tpl_message($monit); } $ft->parse('ROWS', '.form_noteedit');