mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-18 03:33:26 +02:00
Forum boards admin links: csrf + refactor
This commit is contained in:
43
system/templates/forum.admin.links.html.twig
Normal file
43
system/templates/forum.admin.links.html.twig
Normal file
@@ -0,0 +1,43 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form action="{{ getLink('forum') }}" method="post" style="float: left">
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="edit_board" />
|
||||
<input type="hidden" name="id" value="{{ id }}" />
|
||||
<button type="submit" title="Edit"><img src="images/edit.png"/> Edit</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ getLink('forum') }}" method="post" style="float: left">
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="delete_board" />
|
||||
<input type="hidden" name="id" value="{{ id }}" />
|
||||
<button type="submit" onclick="return confirm('Are you sure?');" title="Delete"><img src="images/del.png"/>Delete</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ getLink('forum') }}" method="post" style="float: left">
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="hide_board" />
|
||||
<input type="hidden" name="id" value="{{ id }}" />
|
||||
<button type="submit" title="{% if hide != 1 %}Hide{% else %}Show{% endif %}"><img src="images/{{ hide != 1 ? 'success' : 'error' }}.png"/>{{ hide != 1 ? 'Hide' : 'Show' }}</button>
|
||||
</form>
|
||||
|
||||
{% if i != 1 %}
|
||||
<form action="{{ getLink('forum') }}" method="post" style="float: left">
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="moveup_board" />
|
||||
<input type="hidden" name="id" value="{{ id }}" />
|
||||
<button type="submit" title="Move up"><img src="images/icons/arrow_up.gif"/>Move up</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if i != loop.last %}
|
||||
<form action="{{ getLink('forum') }}" method="post" style="float: left">
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="movedown_board" />
|
||||
<input type="hidden" name="id" value="{{ id }}" />
|
||||
<button type="submit" title="Move down"><img src="images/icons/arrow_down.gif"/>Move down</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
@@ -39,25 +39,7 @@
|
||||
</td>
|
||||
{% if canEdit %}
|
||||
<td>
|
||||
<a href="{{ getLink('forum') }}?action=edit_board&id={{ board.id }}" title="Edit">
|
||||
<img src="images/edit.png"/>Edit
|
||||
</a>
|
||||
<a id="delete" href="{{ getLink('forum') }}?action=delete_board&id={{ board.id }}" onclick="return confirm('Are you sure?');" title="Delete">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="{{ getLink('forum') }}?action=hide_board&id={{ board.id }}" title="{% if board.hide != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if board.hide != 1 %}success{% else %}error{% endif %}.png"/>{% if board.hide != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
{% if i != 1 %}
|
||||
<a href="{{ getLink('forum') }}?action=moveup_board&id={{ board.id }}" title="Move up">
|
||||
<img src="images/icons/arrow_up.gif"/>Move up
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if i != last %}
|
||||
<a href="{{ getLink('forum') }}?action=movedown_board&id={{ board.id }}" title="Move down">
|
||||
<img src="images/icons/arrow_down.gif"/>Move down
|
||||
</a>
|
||||
{% endif %}
|
||||
{{ include('forum.admin.links.html.twig', {id: board.id, hide: board.hide, i: i }) }}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user