Skip to content

Commit

Permalink
Fixed many links to admin panel, if ADMIN_PANEL_FOLDER is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed May 28, 2023
1 parent 080ab56 commit 7dc2e40
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion admin/pages/accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
defined('MYAAC') or die('Direct access not allowed!');

$title = 'Account editor';
$admin_base = BASE_URL . 'admin/?p=accounts';
$admin_base = ADMIN_URL . '?p=accounts';
$use_datatable = true;

if ($config['account_country'])
Expand Down
2 changes: 1 addition & 1 deletion admin/pages/phpinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
<?php return;
}
?>
<iframe src="<?php echo BASE_URL; ?>admin/tools/phpinfo.php" width="1024" height="550"></iframe>
<iframe src="<?php echo ADMIN_URL; ?>tools/phpinfo.php" width="1024" height="550"></iframe>
2 changes: 1 addition & 1 deletion admin/pages/players.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
defined('MYAAC') or die('Direct access not allowed!');

$title = 'Player editor';
$player_base = BASE_URL . 'admin/?p=players';
$player_base = ADMIN_URL . '?p=players';

$use_datatable = true;
require_once LIBS . 'forum.php';
Expand Down
6 changes: 3 additions & 3 deletions system/pages/news.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@
$admin_options = '';
if($canEdit)
{
$admin_options = '<br/><br/><a target="_blank" rel="noopener noreferrer" href="/admin/?p=news&action=edit&id=' . $news['id'] . '" title="Edit">
$admin_options = '<br/><br/><a target="_blank" rel="noopener noreferrer" href="' . ADMIN_URL . '?p=news&action=edit&id=' . $news['id'] . '" title="Edit">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" target="_blank" rel="noopener noreferrer" href="/admin/?p=news&action=delete&id=' . $news['id'] . '" onclick="return confirm(\'Are you sure?\');" title="Delete">
<a id="delete" target="_blank" rel="noopener noreferrer" href="' . ADMIN_URL . '?p=news&action=delete&id=' . $news['id'] . '" onclick="return confirm(\'Are you sure?\');" title="Delete">
<img src="images/del.png"/>Delete
</a>
<a target="_blank" rel="noopener noreferrer" href="/admin/?p=news&action=hide&id=' . $news['id'] . '" title="' . ($news['hidden'] != 1 ? 'Hide' : 'Show') . '">
<a target="_blank" rel="noopener noreferrer" href="' . ADMIN_URL . '?p=news&action=hide&id=' . $news['id'] . '" title="' . ($news['hidden'] != 1 ? 'Hide' : 'Show') . '">
<img src="images/' . ($news['hidden'] != 1 ? 'success' : 'error') . '.png"/>
' . ($news['hidden'] != 1 ? 'Hide' : 'Show') . '
</a>';
Expand Down
8 changes: 4 additions & 4 deletions system/templates/admin.pages.links.html.twig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div style="text-align: right;">
<a href="admin/?p=pages&action=edit&id={{ page.id }}" title="Edit in Admin Panel" target="_blank">
<a href="?p=pages&action=edit&id={{ page.id }}" title="Edit in Admin Panel" target="_blank">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');"
<a id="delete" href="?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');"
title="Delete in Admin Panel" target="_blank">
<img src="images/del.png"/>Delete
</a>
<a href="admin/?p=pages&action=hide&id={{ page.id }}"
<a href="?p=pages&action=hide&id={{ page.id }}"
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
<img src="images/{% if page.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
<br/>
</div>
</div>
4 changes: 2 additions & 2 deletions system/templates/characters.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<td>
{{ hook(constant('HOOK_CHARACTERS_BEFORE_INFORMATIONS')) }}
{% if canEdit %}
<a href="admin/?p=players&id={{ player.getId() }}" title="Edit in Admin Panel" target="_blank">
<a href="{{ constant('ADMIN_URL') }}?p=players&id={{ player.getId() }}" title="Edit in Admin Panel" target="_blank">
<img src="images/edit.png"/>Edit
</a>
{% endif %}
Expand Down Expand Up @@ -418,7 +418,7 @@
{% endif %}
{{ hook(constant('HOOK_CHARACTERS_AFTER_CHARACTERS')) }}
{% if canEdit %}
<a href="admin/?p=players&id={{ player.getId() }}" title="Edit in Admin Panel" target="_blank">
<a href="{{ constant('ADMIN_URL') }}?p=players&id={{ player.getId() }}" title="Edit in Admin Panel" target="_blank">
<img src="images/edit.png"/>Edit
</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion system/templates/tinymce.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
resize: 'both',
image_advtab: true,
images_upload_url: '{{ constant('BASE_URL') }}admin/tools/upload_image.php',
images_upload_url: '{{ constant('ADMIN_URL') }}tools/upload_image.php',
images_upload_credentials: true,
relative_urls: true,
Expand Down
8 changes: 4 additions & 4 deletions templates/tibiacom/news.featured_article.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<b>
<p>{{ article.title|raw }}
{% if canEdit %}
<a href="/admin/?p=news&action=edit&id={{ article.id }}" title="Edit">
<a href="{{ constant('ADMIN_URL') }}?p=news&action=edit&id={{ article.id }}" title="Edit">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" href="/admin/?p=news&action=delete&id={{ article.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<a id="delete" href="{{ constant('ADMIN_URL') }}?p=news&action=delete&id={{ article.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<img src="images/del.png"/>Delete
</a>
<a href="/admin/?p=news&action=hide&id={{ article.id }}" title="{% if article.hidden != 1 %}Hide{% else %}Show{% endif %}">
<a href="{{ constant('ADMIN_URL') }}?p=news&action=hide&id={{ article.id }}" title="{% if article.hidden != 1 %}Hide{% else %}Show{% endif %}">
<img src="images/{% if article.hidden != 1 %}success{% else %}error{% endif %}.png"/>
{% if article.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
Expand All @@ -42,4 +42,4 @@
<div class="Border_1" style="background-image:url({{ template_path }}/images/content/border-1.gif);"></div>
<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url({{ template_path }}/images/content/corner-bl.gif);"></div></div>
<div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url({{ template_path }}/images/content/corner-br.gif);"></div></div>
</div>
</div>
6 changes: 3 additions & 3 deletions templates/tibiacom/news.tickers.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
<div id="TickerEntry-{{ i }}-ShortText" class="NewsTickerShortText">{{ ticker.body_short|raw }}</div>
<div id="TickerEntry-{{ i }}-FullText" class="NewsTickerFullText">{{ ticker.body|raw }}
{% if canEdit %}
<a href="admin/?p=news&action=edit&id={{ ticker.id }}" title="Edit">
<a href="{{ constant('ADMIN_URL') }}?p=news&action=edit&id={{ ticker.id }}" title="Edit">
<img src="images/edit.png"/>
Edit
</a>
<a id="delete" href="admin/?p=news&action=delete&id={{ ticker.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<a id="delete" href="{{ constant('ADMIN_URL') }}?p=news&action=delete&id={{ ticker.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<img src="images/del.png"/>
Delete
</a>
<a href="admin/?p=news&action=hide&id={{ ticker.id }}" title="{% if ticker.hidden != 1 %}Hide{% else %}Show{% endif %}">
<a href="{{ constant('ADMIN_URL') }}?p=news&action=hide&id={{ ticker.id }}" title="{% if ticker.hidden != 1 %}Hide{% else %}Show{% endif %}">
<img src="images/{% if ticker.hidden != 1 %}success{% else %}error{% endif %}.png"/>
{% if ticker.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
Expand Down

0 comments on commit 7dc2e40

Please sign in to comment.