2015-10-19 00:45:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
HTML::title(array('title'=>$L->g('Edit post'), 'icon'=>'pencil'));
|
|
|
|
|
|
|
|
HTML::formOpen(array('class'=>'uk-form-stacked'));
|
|
|
|
|
|
|
|
// Security token
|
|
|
|
HTML::formInputHidden(array(
|
2015-10-20 05:14:28 +02:00
|
|
|
'name'=>'tokenCSRF',
|
2015-11-28 15:47:03 +01:00
|
|
|
'value'=>$Security->getTokenCSRF()
|
2015-10-19 00:45:58 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
// Key input
|
|
|
|
HTML::formInputHidden(array(
|
|
|
|
'name'=>'key',
|
|
|
|
'value'=>$_Post->key()
|
|
|
|
));
|
|
|
|
|
|
|
|
// ---- LEFT SIDE ----
|
|
|
|
echo '<div class="uk-grid">';
|
2015-12-28 23:28:42 +01:00
|
|
|
echo '<div class="uk-width-large-8-10">';
|
2015-10-19 00:45:58 +02:00
|
|
|
|
|
|
|
// Title input
|
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'title',
|
|
|
|
'value'=>$_Post->title(),
|
|
|
|
'class'=>'uk-width-1-1 uk-form-large',
|
|
|
|
'placeholder'=>$L->g('Title')
|
|
|
|
));
|
|
|
|
|
|
|
|
// Content input
|
|
|
|
HTML::formTextarea(array(
|
|
|
|
'name'=>'content',
|
|
|
|
'value'=>$_Post->contentRaw(false),
|
|
|
|
'class'=>'uk-width-1-1 uk-form-large',
|
|
|
|
'placeholder'=>$L->g('Content')
|
|
|
|
));
|
|
|
|
|
|
|
|
// Form buttons
|
|
|
|
echo '<div class="uk-form-row uk-margin-bottom">
|
|
|
|
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
|
|
|
|
<button id="jsdelete-post" name="delete-post" class="uk-button" type="submit">'.$L->g('Delete').'</button>
|
|
|
|
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a>
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
// ---- RIGHT SIDE ----
|
2015-12-28 23:28:42 +01:00
|
|
|
echo '<div class="sidebar uk-width-large-2-10">';
|
2015-10-19 00:45:58 +02:00
|
|
|
|
|
|
|
// Tabs, general and advanced mode
|
|
|
|
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
|
|
|
echo '<li><a href="">'.$L->g('General').'</a></li>';
|
2015-11-04 01:28:11 +01:00
|
|
|
echo '<li><a href="">'.$L->g('Images').'</a></li>';
|
2015-10-19 00:45:58 +02:00
|
|
|
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
|
|
|
|
echo '</ul>';
|
|
|
|
|
|
|
|
echo '<ul id="tab-options" class="uk-switcher uk-margin">';
|
|
|
|
|
|
|
|
// ---- GENERAL TAB ----
|
|
|
|
echo '<li>';
|
|
|
|
|
|
|
|
// Description input
|
|
|
|
HTML::formTextarea(array(
|
|
|
|
'name'=>'description',
|
|
|
|
'label'=>$L->g('description'),
|
|
|
|
'value'=>$_Post->description(),
|
2015-12-28 23:28:42 +01:00
|
|
|
'rows'=>'4',
|
2015-10-19 00:45:58 +02:00
|
|
|
'class'=>'uk-width-1-1 uk-form-medium',
|
|
|
|
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
|
|
|
));
|
|
|
|
|
|
|
|
// Tags input
|
2016-01-12 04:36:48 +01:00
|
|
|
HTML::formInputAutocomplete(array(
|
2015-10-19 00:45:58 +02:00
|
|
|
'name'=>'tags',
|
|
|
|
'value'=>$_Post->tags(),
|
|
|
|
'class'=>'uk-width-1-1 uk-form-large',
|
|
|
|
'tip'=>$L->g('Write the tags separated by commas'),
|
2016-01-12 04:36:48 +01:00
|
|
|
'label'=>$L->g('Tags'),
|
|
|
|
'words'=>'"'.implode('", "', $dbTags->getAll()).'"'
|
2015-10-19 00:45:58 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
echo '</li>';
|
|
|
|
|
2015-11-04 01:28:11 +01:00
|
|
|
// ---- IMAGES TAB ----
|
|
|
|
echo '<li>';
|
|
|
|
|
2015-12-28 23:28:42 +01:00
|
|
|
// --- BLUDIT COVER IMAGE ---
|
2015-12-31 04:01:16 +01:00
|
|
|
echo '<hr>';
|
|
|
|
HTML::bluditCoverImage($_Post->coverImage(false));
|
|
|
|
echo '<hr>';
|
2015-12-28 23:28:42 +01:00
|
|
|
|
|
|
|
// --- BLUDIT QUICK IMAGES ---
|
|
|
|
HTML::bluditQuickImages();
|
|
|
|
|
|
|
|
// --- BLUDIT IMAGES V8 ---
|
|
|
|
HTML::bluditImagesV8();
|
2015-11-04 01:28:11 +01:00
|
|
|
|
|
|
|
echo '</li>';
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
// ---- ADVANCED TAB ----
|
|
|
|
echo '<li>';
|
|
|
|
|
|
|
|
// Status input
|
|
|
|
HTML::formSelect(array(
|
|
|
|
'name'=>'status',
|
|
|
|
'label'=>$L->g('Status'),
|
|
|
|
'class'=>'uk-width-1-1 uk-form-medium',
|
|
|
|
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
|
|
|
|
'selected'=>($_Post->draft()?'draft':'published'),
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2015-12-31 04:01:16 +01:00
|
|
|
// Date input
|
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'date',
|
|
|
|
'value'=>$_Post->dateRaw(),
|
|
|
|
'class'=>'uk-width-1-1 uk-form-large',
|
|
|
|
'tip'=>$L->g('To schedule the post just select the date and time'),
|
|
|
|
'label'=>$L->g('Date')
|
|
|
|
));
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
// Slug input
|
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'slug',
|
|
|
|
'value'=>$_Post->slug(),
|
|
|
|
'class'=>'uk-width-1-1 uk-form-large',
|
|
|
|
'tip'=>$L->g('you-can-modify-the-url-which-identifies'),
|
|
|
|
'label'=>$L->g('Friendly URL')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo '</li>';
|
|
|
|
echo '</ul>';
|
|
|
|
|
|
|
|
echo '</div>';
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
HTML::formClose();
|
|
|
|
|
|
|
|
?>
|
2015-05-05 03:00:01 +02:00
|
|
|
|
|
|
|
<script>
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
2015-08-26 05:42:32 +02:00
|
|
|
var key = $("#jskey").val();
|
|
|
|
|
|
|
|
$("#jsdate").datetimepicker({format:"<?php echo DB_DATE_FORMAT ?>"});
|
|
|
|
|
|
|
|
$("#jstitle").keyup(function() {
|
|
|
|
var slug = $(this).val();
|
|
|
|
checkSlugPost(slug, key, $("#jsslug"));
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#jsslug").keyup(function() {
|
|
|
|
var slug = $("#jsslug").val();
|
|
|
|
checkSlugPost(slug, key, $("#jsslug"));
|
|
|
|
});
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
$("#jsdelete-post").click(function() {
|
2015-08-26 05:42:32 +02:00
|
|
|
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-05-05 03:00:01 +02:00
|
|
|
});
|
|
|
|
|
2015-11-28 15:47:03 +01:00
|
|
|
</script>
|