/** * Возвращает HTML код с опциями причины действия администратора * * @param int $actId код действия * @return string HTML код */ function _getAdmEditReasonOptions($actId) { $sOut = '<option value="" style="color: #777;" selected>Указать вручную</option>'; $aReasons = admin_log::getAdminReasons($actId); if ($aReasons) { foreach ($aReasons as $aOne) { $sBold = $aOne['is_bold'] == 't' ? ' style="background-color: #cdcdcd;"' : ' style="color: #777;"'; $sOut .= '<option value="' . $aOne['id'] . '" ' . $sBold . '>' . $aOne['reason_name'] . '</option>'; } } return $sOut; }
/** * Возвращает HTML код с опциями причины действия администратора * * @param int $actId код действия * @param string $selId поционально. ID выбранной опции * @return string HTML код */ function _getAdminActionReasonOptions($actId, $selId = '') { $sSel = empty($selId) ? ' selected' : ''; $sOut .= '<option value="" ' . $sSel . ' style="color: #777;">Указать вручную</option>'; $aReasons = admin_log::getAdminReasons($actId); if ($aReasons) { foreach ($aReasons as $aOne) { $sSel = $selId == $aOne['id'] ? ' selected' : ''; $sBold = $aOne['is_bold'] == 't' ? ' style="background-color: #cdcdcd;"' : ' style="color: #777;"'; $sOut .= '<option value="' . $aOne['id'] . '" ' . $sSel . $sBold . '>' . $aOne['reason_name'] . '</option>'; } } return $sOut; }
<?php if (!defined('IS_SITE_ADMIN')) { header('Location: /404.php'); exit; } require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php'; $sPrjId = __paramInit('string', 'pid'); $aReasons = admin_log::getAdminReasons(9); $js_file[] = 'banned.js'; if ($sPrjId) { if (!preg_match('/^[\\d]+$/', $sPrjId)) { header_location_exit('/404.php'); } require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/projects.php"; $log = $admin_log->getLogProjById($nCount, $sPrjId); $obj_project = new projects(); $project = $obj_project->GetPrjCust($sPrjId); $project_attach = $obj_project->GetAllAttach($sPrjId); $project_history = $obj_project->GetPrjHistory($sPrjId); } else { $_SESSION['admin_log_proj'] = $_SERVER['REQUEST_URI']; $actions = $admin_log->getAdminActions(admin_log::OBJ_CODE_PROJ); $admins = $admin_log->getAdminsInLog(admin_log::OBJ_CODE_PROJ); $all_specs = professions::GetAllProfessions('', 0, 1); $categories = professions::GetAllGroupsLite(true); $filter_specs = ''; $spec_now = 0; for ($i = 0; $i < sizeof($all_specs); $i++) { if ($all_specs[$i]['groupid'] != $spec_now) {
} 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';