summaryrefslogtreecommitdiff
path: root/views/dashboard.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2018-07-20 17:59:18 -0500
committerAaron Parecki <aaron@parecki.com>2018-07-20 17:59:18 -0500
commitb749bc6c124a02a6949dc67ea703d880e1acd2ac (patch)
treee6695ac1a3a2cb59977d77434179908295e93029 /views/dashboard.php
parent33796f7bd5def85a5753cc3b4430769379b60475 (diff)
disable post type buttons if the server doesn't support them
Diffstat (limited to 'views/dashboard.php')
-rw-r--r--views/dashboard.php34
1 files changed, 25 insertions, 9 deletions
diff --git a/views/dashboard.php b/views/dashboard.php
index adde977..7b8af63 100644
--- a/views/dashboard.php
+++ b/views/dashboard.php
@@ -3,14 +3,30 @@
<div style=" margin-top: 4em; margin-bottom: 4em;">
<ul class="post-type-icons">
- <li><a href="/editor">📄</a></li>
- <li><a href="/new">✏️</a></li>
- <li><a href="/event">📅</a></li>
- <li><a href="/bookmark">🔖</a></li>
- <li><a href="/favorite">👍</a></li>
- <li><a href="/repost">♺</a></li>
- <li><a href="/itinerary">✈️</a></li>
- <li><a href="/review">⭐️</a></li>
+ <?php if(supports_post_type($this->user, 'article')): ?>
+ <li><a href="/editor">📄</a></li>
+ <?php endif; ?>
+ <?php if(supports_post_type($this->user, 'note')): ?>
+ <li><a href="/new">✏️</a></li>
+ <?php endif; ?>
+ <?php if(supports_post_type($this->user, 'event')): ?>
+ <li><a href="/event">📅</a></li>
+ <?php endif; ?>
+ <?php if(supports_post_type($this->user, 'bookmark')): ?>
+ <li><a href="/bookmark">🔖</a></li>
+ <?php endif; ?>
+ <?php if(supports_post_type($this->user, 'like')): ?>
+ <li><a href="/favorite">👍</a></li>
+ <?php endif; ?>
+ <?php if(supports_post_type($this->user, 'repost')): ?>
+ <li><a href="/repost">♺</a></li>
+ <?php endif; ?>
+ <?php if(supports_post_type($this->user, 'itinerary')): ?>
+ <li><a href="/itinerary">✈️</a></li>
+ <?php endif; ?>
+ <?php if(supports_post_type($this->user, 'review')): ?>
+ <li><a href="/review">⭐️</a></li>
+ <?php endif; ?>
<li><a href="/email">✉️</a></li>
<li><a href="/settings">⚙</a></li>
</ul>
@@ -27,4 +43,4 @@
float: left;
margin-right: 12px;
}
-</style> \ No newline at end of file
+</style>