My first dev' question so go easy.
The add-on I'm working on has three basic permissions: can feature a thread, can edit a featured thread, can unfeature a thread.
These permission options/links will be added to the thread tools dropdown.
So far I have this*:
Does that look OK?
Obviously only threads which are currently featured can be edited or unfeatured.
I can't decide whether the initial check should be positive or negative, but I guess it doesn't really make a lot of difference.
Is that the most efficient method?
I should add that there are actually separate permissions for own thread and any thread, but that will be handled within php.
*Thanks to Chris for his input.
The add-on I'm working on has three basic permissions: can feature a thread, can edit a featured thread, can unfeature a thread.
These permission options/links will be added to the thread tools dropdown.
So far I have this*:
Code:
<xen:if is="!{$FeaturedThread}">
<xen:if is="{$canFeatureThread}">
<li><a href="{xen:link 'threads/feature-thread', $thread}" class="OverlayTrigger">{xen:phrase cta_featured_threads_feature_thread}</a></li>
</xen:if>
<xen:else />
<xen:if is="{$canEditFeaturedThread}">
<li><a href="{xen:link 'threads/edit-featured-thread', $thread}" class="OverlayTrigger">{xen:phrase cta_featured_threads_edit_featured_thread}</a></li>
</xen:if>
<xen:if is="{$canUnfeatureThread}">
<li><a href="{xen:link 'threads/unfeature-thread', $thread}" class="OverlayTrigger">{xen:phrase cta_featured_threads_unfeature_thread}</a></li>
</xen:if>
</xen:if>
Obviously only threads which are currently featured can be edited or unfeatured.
I can't decide whether the initial check should be positive or negative, but I guess it doesn't really make a lot of difference.
Is that the most efficient method?
I should add that there are actually separate permissions for own thread and any thread, but that will be handled within php.
*Thanks to Chris for his input.
Last edited: