* added administration panel for screenshots management with auto thumbnail generator

* moved commands & screenshots html code to twig template files
* minimum PHP version to install the MyAAC is now 5.2.0 cause of pathinfo (extension) function
This commit is contained in:
slawkens
2017-08-28 16:27:38 +02:00
parent 7890eb14d1
commit b62ce7ec6f
10 changed files with 452 additions and 121 deletions

View File

@@ -0,0 +1,26 @@
<form method="post" action="{{ link }}">
{% if action == 'edit' %}
<input type="hidden" name="id" value="{{ id }}" />
{% endif %}
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td bgcolor="{{ vdarkborder }}" class="white"><b>{% if action == 'edit' %}Edit{% else %}Add{% endif %} command</b></td>
</tr>
<tr>
<td bgcolor="{{ darkborder }}">
<table border="0" cellpadding="1">
<tr>
<td>Words:</td>
<td><input name="words" value="{% if words is not null %}{{ words }}{% endif %}" size="29" maxlength="29"/></td>
<tr>
<td>Description:</td>
<td><textarea name="description" maxlength="300" cols="50" rows="5">{% if description is not null %}{{ description }}{% endif %}</textarea></td>
<tr/>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit"/>
</tr>
</table>
</td>
</tr>
</table>
</form>

View File

@@ -0,0 +1,40 @@
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td bgcolor="{{ vdarkborder }}" class="white" width="150"><b>Words</b></td>
<td bgcolor="{{ vdarkborder }}" class="white"><b>Description</b></td>
{% if canEdit %}
<td bgcolor="{{ vdarkborder }}" class="white"><b>Options</b></td>
{% endif %}
</tr>
{% set i = 0 %}
{% for command in commands %}
{% set i = i + 1 %}
<tr bgcolor="{{ getStyle(i) }}">
<td>{{ command.words }}</td>
<td><i>{{ command.description }}</i></td>
{% if canEdit %}
<td>
<a href="?subtopic=commands&action=edit&id={{ command.id }}" title="Edit">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" href="?subtopic=commands&action=delete&id={{ command.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<img src="images/del.png"/>Delete
</a>
<a href="?subtopic=commands&action=hide&id={{ command.id }}" title="{% if command.hidden != 1 %}Hide{% else %}Show{% endif %}">
<img src="images/{% if command.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if command.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
{% if i != 1 %}
<a href="?subtopic=commands&action=moveup&id={{ command.id }}" title="Move up">
<img src="images/icons/arrow_up.gif"/>Move up
</a>
{% endif %}
{% if i != last %}
<a href="?subtopic=commands&action=movedown&id={{ command.id }}" title="Move down">
<img src="images/icons/arrow_down.gif"/>Move down
</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</table>

View File

@@ -0,0 +1,32 @@
<form method="post" action="{{ link }}">
{% if action == 'edit' %}
<input type="hidden" name="id" value="{{ id }}" />
{% endif %}
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td bgcolor="{{ vdarkborder }}" class="white"><b>{% if action == 'edit' %}Edit{% else %}Add{% endif %} screenshot</b></td>
</tr>
<tr>
<td bgcolor="{{ darkborder }}">
<table border="0" cellpadding="1">
<tr>
<td>Comment:</td>
<td><textarea name="comment" maxlength="255" cols="50" rows="5">{% if comment is not null %}{{ comment }}{% endif %}</textarea></td>
<tr/>
<tr>
<td>Image URL:</td>
<td><input name="image" value="{% if image is not null %}{{ image }}{% endif %}" size="50" maxlength="255"/></td>
<tr/>
<tr>
<td>Author:</td>
<td><input name="author" value="{% if author is not null %}{{ author }}{% endif %}" size="50" maxlength="50"/></td>
<tr/>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit"/>
</tr>
</table>
</td>
</tr>
</table>
</form>
<br/><br/>

View File

@@ -0,0 +1,16 @@
<div style="position: relative; height: 15px; width: 100%;">
<?php if($next_screenshot): ?>
{% if next is not null %}
<a style="float: right;" href="?subtopic=screenshots&screenshot={{ next }}" >next <img src="images/arrow_right.gif" width=15 height=11 border=0 ></a>
{% endif %}
{% if previous is not null %}
<a style="position: absolute;" href="?subtopic=screenshots&screenshot={{ previous }}"><img src="images/arrow_left.gif" width=15 height=11 border=0 > previous</a>
{% endif %}
<div style="position: absolute; width: 80%; margin-left: 10%; margin-right: 10%; text-align: center;">
<a href="?subtopic=screenshots" ><img src="images/arrow_up.gif" width=11 height=15 border=0 > back</a>
</div>
</div>
<div style="position: relative; text-align: center; top: 20px; ">
<img src="{{ screenshot.image }}" />
<div style="margin-top: 15px; margin-bottom: 35px; ">{{ screenshot.comment }}</div>
</div>

View File

@@ -0,0 +1,38 @@
Click on the image to enlarge.<br/><br/>
{% set i = 0 %}
{% for screenshot in screenshots %}
{% set i = i + 1 %}
<table>
<tr>
<td style="height: 120px;" >
<a href="?subtopic=screenshots&screenshot={{ screenshot.id }}" >
<img src="{{ screenshot.thumb }}" border="0" />
</a>
</td>
<td>{{ screenshot.comment }}</td>
{% if canEdit %}
<td>
<a href="?subtopic=screenshots&action=edit&id={{ screenshot.id }}" title="Edit">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" href="?subtopic=screenshots&action=delete&id={{ screenshot.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<img src="images/del.png"/>Delete
</a>
<a href="?subtopic=screenshots&action=hide&id={{ screenshot.id }}" title="{% if screenshot.hidden != 1 %}Hide{% else %}Show{% endif %}">
<img src="images/{% if screenshot.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if screenshot.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
{% if i != 1 %}
<a href="?subtopic=screenshots&action=moveup&id={{ screenshot.id }}" title="Move up">
<img src="images/icons/arrow_up.gif"/>Move up
</a>
{% endif %}
{% if i != last %}
<a href="?subtopic=screenshots&action=movedown&id={{ screenshot.id }}" title="Move down">
<img src="images/icons/arrow_down.gif"/>Move down
</a>
{% endif %}
</td>
{% endif %}
</tr>
</table>
{% endfor %}