mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00

* added networks (facebook and twitter) and highscores (top 5) boxes to tibiacom template, configurable in templates/tibiacom/config.php * fixed polls box in tibiacom template * (internal) moved tibiacom boxes to separate directory * (internal) renamed constant TICKET -> TICKER
153 lines
5.5 KiB
Twig
153 lines
5.5 KiB
Twig
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
|
<script type="text/javascript">
|
|
tinymce.init({
|
|
selector : "#body",
|
|
theme : "modern",
|
|
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code',
|
|
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
|
image_advtab: true
|
|
});
|
|
</script>
|
|
{% if action != 'edit' %}
|
|
<a id="news-button" href="#">Add news</a>
|
|
{% endif %}
|
|
<form method="post" action="{{ news_link_form }}">
|
|
{% if action == 'edit' %}
|
|
<input type="hidden" name="id" value="{{ news_id }}" />
|
|
{% endif %}
|
|
<table id="news-edit" width="100%" border="0" cellspacing="1" cellpadding="4">
|
|
<tr>
|
|
<td colspan="2" bgcolor="{{ config.vdarkborder }}" class="white"><b>{% if action == 'edit'%}Edit{% else %}Add{% endif %} news</b></td>
|
|
</tr>
|
|
|
|
{% set rows = 1 %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td><b>Title:</b></td>
|
|
<td><input name="title" value="{{ title }}" size="50" maxlength="100"/></td>
|
|
</tr>
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<!--td>Description:</td-->
|
|
<td colspan="2"><textarea name="body" id="body" maxlength="{{ constant('BODY_LIMIT') }}" class="tinymce">{{ body }}</textarea></td>
|
|
<tr/>
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td><b>Type:</b></td>
|
|
<td>
|
|
<select name="type" id="select-type"{% if action == 'edit' %} disabled{% endif %}>
|
|
<option value="{{ constant('NEWS') }}" {% if type is defined and type == constant('NEWS') %}selected="yes"{% endif %}>News</option>
|
|
<option value="{{ constant('TICKER') }}" {% if type is defined and type == constant('TICKER') %}selected="yes"{% endif %}>Ticket</option>
|
|
<option value="{{ constant('ARTICLE') }}" {% if type is defined and type == constant('ARTICLE') %}selected="yes"{% endif %}>Article</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr id="article-text" bgcolor="{{ getStyle(rows) }}"{% if article_text is empty %} style="display: none;"{% endif %}>
|
|
<td><b>Article short text:<br/>This will be displayed on news page.<br/>Rest will be available on "read more" page.</b></td>
|
|
<td>
|
|
<textarea name="article_text">{% if article_text is not empty %}{{ article_text }}{% endif %}</textarea>
|
|
</td>
|
|
</tr>
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr id="article-image" bgcolor="{{ getStyle(rows) }}"{% if article_image is empty %} style="display: none;"{% endif %}>
|
|
<td><b>Article image:</b></td>
|
|
<td>
|
|
<input type="text" name="article_image" value="{% if article_image is not empty %}{{ article_image }}{% else %}images/news/announcement.jpg{% endif %}" />
|
|
</td>
|
|
</tr>
|
|
|
|
{% if action == 'edit' %}
|
|
{% set rows = rows + 1 %}
|
|
{% if player is defined %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td width="180"><b>Author:</b></td>
|
|
<td>
|
|
<select name="original_id" disabled="disabled">
|
|
<option value="{{ player.getId() }}">{{ player.getName() }}</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td width="180"><b>{% if action == 'edit' %}Modified by{% else %}Author{% endif %}:</b></td>
|
|
<td>
|
|
<select name="player_id">
|
|
{% for player in account_players %}
|
|
<option value="{{ player.getId() }}"{% if player_id is defined and player.getId() == player_id %} selected="selected"{% endif %}>{{ player.getName() }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td><b>Category:</b></td>
|
|
<td>
|
|
{% for id, cat in categories %}
|
|
<input type="radio" name="category" value="{{ id }}" {% if (category == 0 and id == 1) or (category == id) %}checked="yes"{% endif %}/> <img src="images/news/icon_{{ cat.icon_id }}_small.gif" />
|
|
{% endfor %}
|
|
</td>
|
|
</tr>
|
|
|
|
{% if action == '' %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td><b>Create forum thread in section:</b></td>
|
|
<td>
|
|
<select name="forum_section">
|
|
<option value="-1">None</option>
|
|
{% for section in forum_boards %}
|
|
<option value="{{ section.id }}" {% if forum_section is defined and forum_section == section.id %}checked="yes"{% endif %}/>{{ section.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
{% elseif comments is not null%}
|
|
<input type="hidden" name="forum_section" value="{{ comments }}" />
|
|
{% endif %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td align="right">
|
|
<input type="submit" value="Submit"/>
|
|
</td>
|
|
<td align="left">
|
|
<input type="button" onclick="window.location = '{{ news_link }}';" value="Cancel"/>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
{% if action != 'edit' %}
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$("#news-edit").hide();
|
|
|
|
$("#news-button").click(function() {
|
|
$("#news-edit").toggle();
|
|
return false;
|
|
});
|
|
|
|
$('#select-type').change(function() {
|
|
var value = $('#select-type').val();
|
|
if(value == {{ constant('ARTICLE') }}) {
|
|
$('#article-text').show();
|
|
$('#article-image').show();
|
|
}
|
|
else {
|
|
$('#article-text').hide();
|
|
$('#article-image').hide();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endif %} |