Remove url filter /blog/ #557
This commit is contained in:
parent
e7fe2f4cbf
commit
71528b2e5c
@ -102,7 +102,8 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
|
||||
'label'=>$L->g('Blog'),
|
||||
'value'=>$Site->uriFilters('blog'),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>DOMAIN_BLOG
|
||||
'tip'=>DOMAIN.$Site->uriFilters('blog'),
|
||||
'disabled'=>!$Site->uriFilters('blog')
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
@ -113,3 +114,21 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
|
||||
</div>';
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#jshomepage").change(function() {
|
||||
if ($(this).val()==' ') {
|
||||
$("#jsuriBlog").attr('value', '');
|
||||
$("#jsuriBlog").attr('disabled', 'disabled');
|
||||
} else {
|
||||
$("#jsuriBlog").removeAttr('disabled');
|
||||
$("#jsuriBlog").attr('value', '/blog/');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
@ -198,9 +198,6 @@ define('CATEGORY_URI_FILTER', $Url->filters('category'));
|
||||
// Page URI filter
|
||||
define('PAGE_URI_FILTER', $Url->filters('page'));
|
||||
|
||||
// Blog URI filter
|
||||
define('BLOG_URI_FILTER', $Url->filters('blog'));
|
||||
|
||||
// Content order by: date / position
|
||||
define('ORDER_BY', $Site->orderBy());
|
||||
|
||||
@ -234,7 +231,6 @@ define('DOMAIN_ADMIN', DOMAIN_BASE.ADMIN_URI_FILTER);
|
||||
define('DOMAIN_TAGS', Text::addSlashes(DOMAIN_BASE.TAG_URI_FILTER, false, true));
|
||||
define('DOMAIN_CATEGORIES', Text::addSlashes(DOMAIN_BASE.CATEGORY_URI_FILTER, false, true));
|
||||
define('DOMAIN_PAGES', Text::addSlashes(DOMAIN_BASE.PAGE_URI_FILTER, false, true));
|
||||
define('DOMAIN_BLOG', Text::addSlashes(DOMAIN_BASE.BLOG_URI_FILTER, false, true));
|
||||
|
||||
$ADMIN_CONTROLLER = '';
|
||||
$ADMIN_VIEW = '';
|
||||
|
@ -67,19 +67,10 @@ class dbSite extends dbJSON
|
||||
public function uriFilters($filter='')
|
||||
{
|
||||
$filters['admin'] = '/'.ADMIN_URI_FILTER;
|
||||
$filters['page'] = $this->getField('uriPage');
|
||||
$filters['tag'] = $this->getField('uriTag');
|
||||
$filters['category'] = $this->getField('uriCategory');
|
||||
|
||||
if ($this->getField('uriPage')) {
|
||||
$filters['page'] = $this->getField('uriPage');
|
||||
}
|
||||
|
||||
if ($this->getField('uriTag')) {
|
||||
$filters['tag'] = $this->getField('uriTag');
|
||||
}
|
||||
|
||||
if ($this->getField('uriCategory')) {
|
||||
$filters['category'] = $this->getField('uriCategory');
|
||||
}
|
||||
|
||||
if ($this->getField('uriBlog')) {
|
||||
$filters['blog'] = $this->getField('uriBlog');
|
||||
}
|
||||
@ -88,7 +79,11 @@ class dbSite extends dbJSON
|
||||
return $filters;
|
||||
}
|
||||
|
||||
return $filters[$filter];
|
||||
if (isset($filters[$filter])) {
|
||||
return $filters[$filter];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns the URL of the rss.xml file
|
||||
|
@ -659,15 +659,19 @@ function editSettings($args) {
|
||||
if (isset($args['uriPage'])) {
|
||||
$args['uriPage'] = Text::addSlashes($args['uriPage']);
|
||||
}
|
||||
|
||||
if (isset($args['uriTag'])) {
|
||||
$args['uriTag'] = Text::addSlashes($args['uriTag']);
|
||||
}
|
||||
|
||||
if (isset($args['uriCategory'])) {
|
||||
$args['uriCategory'] = Text::addSlashes($args['uriCategory']);
|
||||
}
|
||||
|
||||
if (isset($args['uriBlog'])) {
|
||||
$args['uriBlog'] = Text::addSlashes($args['uriBlog']);
|
||||
} else {
|
||||
$args['uriBlog'] = '';
|
||||
}
|
||||
|
||||
if ($Site->set($args)) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
<h1 class="title"><?php echo $page->title(); ?></h1>
|
||||
</a>
|
||||
|
||||
<?php if (!$page->isStatic()): ?>
|
||||
<?php if (!$page->isStatic() && !$Url->notFound()): ?>
|
||||
<!-- Creation date -->
|
||||
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $Language->get('Reading time') . ': ' . $page->readingTime() ?></h6>
|
||||
<?php endif ?>
|
||||
|
Loading…
Reference in New Issue
Block a user