Skip to content

Commit

Permalink
0.0.9/feature - Переадресация на редактирование галереии при создании…
Browse files Browse the repository at this point in the history
… галереи
  • Loading branch information
Максим Шульга committed Nov 29, 2014
1 parent 83e9c5b commit c3f4ff7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion classes/class.seagullgallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,11 @@ function saveGallery($aData) { //--------------------------------

if ($r) {
$this->msg->setOk('Галерея добавлена');
$this->msg->setVar('gallery_id', $gallery_id);
}
else
else {
$this->msg->setError('Ошибка сохранения в БД');
}
return $gallery_id;
}
else {
Expand Down
7 changes: 6 additions & 1 deletion js/seagullgallery_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ $(document).ready(function() {
$('#f-add-gallery').ajaxForm({ url:ajaxurl, dataType:'json',
success: function(data) {
msg.showAjax(data);

$(this).oneTime('1s', function() {
postForm('editGallery', data.gallery_id);
});

},
error: function(data){
msg.show('Ошибка при отправке запроса', 'error');
Expand Down Expand Up @@ -64,4 +69,4 @@ $(document).ready(function() {
return false;
});

});
});
4 changes: 2 additions & 2 deletions templates/addgallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>[+title+]</h1>
<form id="f-add-gallery" style="padding:10px;" name="module" method="post">
[+form_gallery+]
<input name="cmd" type="hidden" value="addGallery" />
<input name="gid" type="hidden" value="[+row_id+]" />
<input name="itemID" type="hidden" value="[+row_id+]" />
</form>

<ul class="actionButtons" style="margin-left: 10px;">
Expand All @@ -22,4 +22,4 @@ <h1>[+title+]</h1>
<script type="text/javascript" src="../assets/modules/[+nameModule+]/js/[+nameModule+]_config.js"></script>
<script type="text/javascript" src="../assets/modules/seagulllibrary/js/jpicker-1.1.6.min.js"></script>
</body>
</html>
</html>

0 comments on commit c3f4ff7

Please sign in to comment.