Файл: plugins/diary/inc/access.php
Строк: 30
<?php
$get_act = $tools->keyGlobals('act', 'get', 'edit');
$access_type = $tools->keyGlobals('edit', 'get', 'private');
if (!isset($accessTitle[$get_act])) {
$accessTitle[$get_act] = 'Ошибка доступа';
}
if ($get_act == 'edit') {
$typeEdit = array(
'id' => ($access_type == 'comment' ? 'private_komm' : 'private'),
'name' => ($access_type == 'comment' ? 'Комментирование доступно' : 'Кто видит запись'),
);
}
if ($maps['diary_id'] != 0) {
$diary = mysql_fetch_assoc(mysql_query("
SELECT n.*
FROM notes AS n WHERE n.id = " . (int) $maps['diary_id']));
} else {
$diary = array('id' => 0,
'private' => $tools->keyGlobals('diary_access', 'sess', 0),
'private_komm' => $tools->keyGlobals('diary_comment', 'sess', 0),
'name' => 'Новая запись',
'msg' => $tools->keyGlobals('diary_message', 'sess', NULL),
);
}
if (!isset($diary['id'])) {
header('Location: ?');
exit;
}
$set['title'] = (isset($accessTitle[$get_act]) ? $accessTitle[$get_act] : 'Ошибка доступа');
require H.'sys/inc/thead.php';
title();
aut();
err();
?>
<ol class="breadcrumb">
<li><a href="/index.php"><i class="ic ic-home"></i></a></li>
<li><a href="?"><?= __('Дневники')?></a></li>
<li>
<a href="?f=<?= $maps['r']?>&s=<?= $maps['s']?>&q=<?= $maps['search']?>&r=access&u=<?= $maps['u']?>&zsort=<?= $maps['zsort']?>&id=<?= $maps['diary_id']?>">
<?= $classDiary->get_name($diary['name'], $diary['msg'])?>
</a>
</li>
<li><?= $accessTitle[$get_act]?></li>
</ol>
<?
if ($get_act == 'edit' && $user_id) {
?>
<form class="form-post-access" action="?f=<?= $maps['f']?>&s=<?= $maps['s']?>&q=<?= $maps['search']?>&r=<?= $maps['r']?>&u=<?= $maps['u']?>&page=<?= $maps['page']?>&zsort=<?= $maps['zsort']?>&id=<?= $maps['diary_id']?>&act=edit&edit=<?= $access_type?>" method="POST">
<div class="access-header">
<?= $typeEdit['name']?>:
</div>
<? foreach($accessList AS $key => $value) { ?>
<label>
<img src="/style/icons/<?= $value['icon']?>.png" />
<input type="radio" name="<?= $typeEdit['id']?>" value="<?= $key?>" <?= ($diary[$typeEdit['id']] == $key ? 'checked' : '')?> />
<?= $value['name']?>
</label>
<? } ?>
<button type="submit" name="access"><?= __('Сохранить')?></button>
</form>
<?
} else {
?>
<div class="alert alert-warning">
<?= __('Автор ограничил доступ к этому дневнику.')?><br />
<a href="?f=index&s=<?= $maps['s']?>&q=<?= $maps['search']?>&r=<?= $maps['r']?>&u=<?= $maps['u']?>&zsort=<?= $maps['zsort']?>">← <?= __('Вернуться')?></a>
</div>
<?
}