ADD модерация точек, пока без фильтрации при выводе
This commit is contained in:
parent
238f84cf4f
commit
56e91524b4
|
|
@ -42,6 +42,7 @@ class JsonController extends Controller
|
||||||
$point->descriptionHtml = nl2br($point->description);
|
$point->descriptionHtml = nl2br($point->description);
|
||||||
$point->descriptionHtml = Helper::replaceLinks($point->descriptionHtml, '/?point=');
|
$point->descriptionHtml = Helper::replaceLinks($point->descriptionHtml, '/?point=');
|
||||||
$point->name = htmlspecialchars($point->name);
|
$point->name = htmlspecialchars($point->name);
|
||||||
|
$point->moderate = $point->moderate ? 'show' : 'hide';
|
||||||
$imgs = $point->photos;
|
$imgs = $point->photos;
|
||||||
$photosCount = 1;
|
$photosCount = 1;
|
||||||
|
|
||||||
|
|
@ -226,6 +227,7 @@ class JsonController extends Controller
|
||||||
{
|
{
|
||||||
$_POST['author'] = App::$user->id;
|
$_POST['author'] = App::$user->id;
|
||||||
$_POST['date'] = time();
|
$_POST['date'] = time();
|
||||||
|
$_POST['moderate'] = (App::$user && App::$user->isAdmin == 1) ? $_POST['moderate'] : 0;
|
||||||
$point->add($_POST);
|
$point->add($_POST);
|
||||||
|
|
||||||
if (!$point->id)
|
if (!$point->id)
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,10 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
<select id="moderate" name="moderate" class="form-control" style="width: 40%; display: <?= (App::$user && App::$user->isAdmin == 1)?'inline-block':'none'?>; padding-top: 5px; float: left;">
|
||||||
|
<option value="hide">Скрыта - на модераци</option>
|
||||||
|
<option value="show">Опубликована</option>
|
||||||
|
</select>
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button>
|
||||||
<button type="button" class="btn btn-primary" onclick="addPoint();">Сохранить</button>
|
<button type="button" class="btn btn-primary" onclick="addPoint();">Сохранить</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -287,6 +287,7 @@ function addPoint()
|
||||||
source: $('#addPointSource').val(),
|
source: $('#addPointSource').val(),
|
||||||
lat: $('#addPointLat').val(),
|
lat: $('#addPointLat').val(),
|
||||||
lng: $('#addPointLng').val(),
|
lng: $('#addPointLng').val(),
|
||||||
|
moderate: $('#moderate').val() == 'show' ? 1:0,
|
||||||
id: id
|
id: id
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|
@ -387,6 +388,7 @@ function editPoint(id)
|
||||||
$('#addPointSource').val(pointsSources[id].source);
|
$('#addPointSource').val(pointsSources[id].source);
|
||||||
$('#addPointLat').val(pointsSources[id].lat);
|
$('#addPointLat').val(pointsSources[id].lat);
|
||||||
$('#addPointLng').val(pointsSources[id].lng);
|
$('#addPointLng').val(pointsSources[id].lng);
|
||||||
|
$('#moderate').val(pointsSources[id].moderate);
|
||||||
|
|
||||||
$('.extraImage', '#imgsContainer').remove();
|
$('.extraImage', '#imgsContainer').remove();
|
||||||
if (pointsSources[id].images != undefined && pointsSources[id].images.length > 0)
|
if (pointsSources[id].images != undefined && pointsSources[id].images.length > 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue