Add functions for entry check

This commit is contained in:
Guillaume Zin 2018-03-22 13:31:44 +01:00 committed by onli
parent eafc4dd625
commit d459d54271
2 changed files with 22 additions and 4 deletions

View File

@ -88,7 +88,7 @@
<a class="button_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=delete&amp;serendipity[id]={$entry_vars.entry.id}&amp;{$entry_vars.urlToken}" title="{$CONST.DELETE}"><span class="icon-trash" aria-hidden="true"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a>
{/if}
<input class="entry_preview" type="submit" value="{$CONST.PREVIEW}">
<input type="submit" value="{$CONST.SAVE}">
<input type="submit" onclick="return serendipity.checkSave();" value="{$CONST.SAVE}">
</div>
<div id="edit_entry_metadata" class="clearfix">
@ -170,4 +170,4 @@
{$wysiwyg_block_item|emit_htmlarea_code:$wysiwyg_block_jsname}
{/foreach}
{$entry_vars.wysiwyg_blocks|serendipity_refhookPlugin:'backend_wysiwyg_finish'}
{/if}
{/if}

View File

@ -659,11 +659,29 @@
}
}
// ..?
// check that the entry is validated for saving, used mainly by serendipity_event_entrycheck
serendipity.checkSave = function() {
{serendipity_hookPlugin hook='backend_entry_checkSave' hookAll='true'}
return true;
}
// set a category to checked
serendipity.enableCategory = function(catNumber) {
$("#" + "serendipity_category_" + catNumber).prop("checked", true);
}
// is no category enabled?
serendipity.hasNoCategoryEnabled = function() {
var $source = $('#edit_entry_category');
var $selected = $source.find('input:checkbox:checked');
if ($selected.length > 0) {
return false;
}
else {
return true;
}
}
// save in which directory the first uploaded files is stored (the default when only inserting one file)
serendipity.rememberUploadOptions = function() {
@ -1805,4 +1823,4 @@ serendipity_imageSelector_done = function(textarea) {
serendipity_imageSelector_addToElement = function(str, id) {
return serendipity.serendipity_imageSelector_addToElement(str, id);
}
}