示例#1
0
        }
        break;
    case 'edit':
        $sCmd = __paramInit('string', null, 'cmd');
        if ($sCmd == 'go') {
            $sName = substr(trim($_POST['reason_name']), 0, 64);
            $sReason = trim($_POST['reason_text']);
            $sNameError = !$sName ? 'Укажите Название причины' : '';
            $sTextError = !$sReason ? 'Укажите Текст причины' : '';
            if ($reasonId && !$sNameError && !$sTextError) {
                admin_log::updateAdminReason($reasonId, $sName, $sReason, !empty($_POST['is_bold']) ? 't' : 'f');
                header('Location: /siteadmin/proj_reasons?act_sel=' . $act_sel);
            }
        }
        $aReason = admin_log::getAdminReason($reasonId);
        break;
    case 'del':
        admin_log::deleteAdminReason($reasonId);
        break;
}
$sFormTitle = $sAction == 'edit' ? 'Редактировать причину: ' . $aReason['reason_name'] : 'Новая причина';
$aReasons = admin_log::getAdminReasons($act_sel, false);
$no_banner = 1;
$rpath = '../../';
$js_file = array('admin_log.js');
$css_file = array('moderation.css', 'new-admin.css', 'nav.css');
$content = '../content.php';
$header = $rpath . 'header.php';
$footer = $rpath . 'footer.html';
$inner_page = 'inner_index.php';
include $rpath . 'template.php';