mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-13 08:14:31 +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>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?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'])) {
|
if (empty($_REQUEST['creature'])) {
|
||||||
//send query to database
|
//send query to database
|
||||||
$monsters = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 ORDER BY name asc');
|
$monsters = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 ORDER BY name asc');
|
||||||
|
@ -11,15 +11,6 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Spells';
|
$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'])) {
|
if(isset($_REQUEST['vocation_id'])) {
|
||||||
$vocation_id = $_REQUEST['vocation_id'];
|
$vocation_id = $_REQUEST['vocation_id'];
|
||||||
if($vocation_id == 'all') {
|
if($vocation_id == 'all') {
|
||||||
|
@ -32,13 +32,6 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</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">
|
<form action="{{ getLink('spells') }}" method="post">
|
||||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||||
<tr bgcolor="{{ config.vdarkborder }}">
|
<tr bgcolor="{{ config.vdarkborder }}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user