Mass tag: don't show buttons if no tag specified
This commit is contained in:
parent
1f2ce725ff
commit
601bdab8e1
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
<?php $classNames = ['post', 'post-type-' . TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type))] ?>
|
<?php $classNames = ['post', 'post-type-' . TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type))] ?>
|
||||||
<?php if (isset($this->context->source) and $this->context->source == 'mass-tag'): ?>
|
<?php $masstag = (isset($this->context->source) and $this->context->source == 'mass-tag' and !empty($this->context->additionalInfo)) ?>
|
||||||
|
<?php if ($masstag): ?>
|
||||||
<?php $classNames []= 'taggable' ?>
|
<?php $classNames []= 'taggable' ?>
|
||||||
<?php if (in_array($this->context->additionalInfo, array_map(function($x) { return $x->name; }, $this->context->post->sharedTag))): ?>
|
<?php if (in_array($this->context->additionalInfo, array_map(function($x) { return $x->name; }, $this->context->post->sharedTag))): ?>
|
||||||
<?php $classNames []= 'tagged' ?>
|
<?php $classNames []= 'tagged' ?>
|
||||||
|
@ -7,7 +8,7 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<div class="<?php echo implode(' ', $classNames) ?>">
|
<div class="<?php echo implode(' ', $classNames) ?>">
|
||||||
<?php if (isset($this->context->source) and $this->context->source == 'mass-tag'): ?>
|
<?php if ($masstag): ?>
|
||||||
<a class="toggle-tag" href="<?php echo \Chibi\UrlHelper::route('post', 'toggle-tag', ['id' => $this->context->post->id, 'tag' => $this->context->additionalInfo]) ?>" data-text-tagged="Tagged" data-text-untagged="Untagged">
|
<a class="toggle-tag" href="<?php echo \Chibi\UrlHelper::route('post', 'toggle-tag', ['id' => $this->context->post->id, 'tag' => $this->context->additionalInfo]) ?>" data-text-tagged="Tagged" data-text-untagged="Untagged">
|
||||||
<?php echo in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?>
|
<?php echo in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue