mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-10 14:54:30 +02:00
Creatures and monsters are now reloaded in Admin Panel
This commit is contained in:
parent
41e24ca535
commit
9fe419cfe7
@ -23,26 +23,6 @@ $title = "Creatures";
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$canEdit = hasFlag(FLAG_CONTENT_MONSTERS) || admin();
|
||||
if (isset($_POST['reload_monsters']) && $canEdit) {
|
||||
require LIBS . 'creatures.php';
|
||||
if (Creatures::loadFromXML(true)) {
|
||||
if (Creatures::getMonstersList()->hasErrors())
|
||||
error('There were some problems loading your monsters.xml file. Please check system/logs/error.log for more info.');
|
||||
} else {
|
||||
error(Creatures::getLastError());
|
||||
}
|
||||
}
|
||||
|
||||
if ($canEdit) {
|
||||
?>
|
||||
<form method="post" action="<?php echo getLink('creatures'); ?>">
|
||||
<input type="hidden" name="reload_monsters" value="yes"/>
|
||||
<input type="submit" value="(admin) Reload monsters"/>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (empty($_REQUEST['creature'])) {
|
||||
//send query to database
|
||||
$monsters = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 ORDER BY name asc');
|
||||
@ -170,4 +150,4 @@ if (empty($_REQUEST['creature'])) {
|
||||
|
||||
</script>
|
||||
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/datatables.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/datatables.min.js"></script>
|
||||
|
@ -11,15 +11,6 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Spells';
|
||||
|
||||
$canEdit = hasFlag(FLAG_CONTENT_SPELLS) || admin();
|
||||
if(isset($_POST['reload_spells']) && $canEdit)
|
||||
{
|
||||
require LIBS . 'spells.php';
|
||||
if(!Spells::loadFromXML(true)) {
|
||||
error(Spells::getLastError());
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['vocation_id'])) {
|
||||
$vocation_id = $_REQUEST['vocation_id'];
|
||||
if($vocation_id == 'all') {
|
||||
@ -90,4 +81,4 @@ $twig->display('spells.html.twig', array(
|
||||
} );
|
||||
|
||||
</script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/datatables.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/datatables.min.js"></script>
|
||||
|
@ -32,13 +32,6 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
{% if canEdit %}
|
||||
<form method="post" action="{{ getLink('spells') }}">
|
||||
<input type="hidden" name="reload_spells" value="yes"/>
|
||||
<input type="submit" value="(admin) Reload spells"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<form action="{{ getLink('spells') }}" method="post">
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
@ -198,4 +191,4 @@
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user