mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-18 03:33:26 +02:00
Merge branch 'develop' into feature/debug-bar
This commit is contained in:
@@ -140,8 +140,8 @@ class CreateCharacter
|
||||
if(empty($errors))
|
||||
{
|
||||
$number_of_players_on_account = $account->getPlayersList(true)->count();
|
||||
if($number_of_players_on_account >= config('characters_per_account'))
|
||||
$errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.config('characters_per_account').')</b>!';
|
||||
if($number_of_players_on_account >= setting('core.characters_per_account'))
|
||||
$errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account . '/' . setting('core.characters_per_account') . ')</b>!';
|
||||
}
|
||||
|
||||
if(empty($errors))
|
||||
|
@@ -60,6 +60,16 @@ class Settings implements ArrayAccess
|
||||
}
|
||||
|
||||
$settings = $this->settingsFile[$pluginName];
|
||||
|
||||
global $hooks;
|
||||
if (!$hooks->trigger(HOOK_ADMIN_SETTINGS_BEFORE_SAVE, [
|
||||
'name' => $pluginName,
|
||||
'values' => $values,
|
||||
'settings' => $settings,
|
||||
])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($settings['callbacks']['beforeSave'])) {
|
||||
if (!$settings['callbacks']['beforeSave']($settings, $values)) {
|
||||
return false;
|
||||
|
@@ -95,6 +95,7 @@ class Changelog
|
||||
if (!$row->save()) {
|
||||
$errors[] = 'Fail during toggle hidden Changelog.';
|
||||
}
|
||||
$status = $row->hidden;
|
||||
} else {
|
||||
$errors[] = 'Changelog with id ' . $id . ' does not exists.';
|
||||
}
|
||||
|
@@ -10,13 +10,13 @@
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$configForumTablePrefix = setting('core.forum_table_prefix');
|
||||
if(null !== $configForumTablePrefix && !empty(trim($configForumTablePrefix))) {
|
||||
if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) {
|
||||
$settingForumTablePrefix = setting('core.forum_table_prefix');
|
||||
if(null !== $settingForumTablePrefix && !empty(trim($settingForumTablePrefix))) {
|
||||
if(!in_array($settingForumTablePrefix, array('myaac_', 'z_'))) {
|
||||
throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".');
|
||||
}
|
||||
|
||||
define('FORUM_TABLE_PREFIX', $configForumTablePrefix);
|
||||
define('FORUM_TABLE_PREFIX', $settingForumTablePrefix);
|
||||
}
|
||||
else {
|
||||
if($db->hasTable('z_forum')) {
|
||||
|
@@ -75,18 +75,20 @@ class News
|
||||
|
||||
static public function delete($id, &$errors)
|
||||
{
|
||||
if(isset($id))
|
||||
{
|
||||
if(isset($id)) {
|
||||
$row = ModelsNews::find($id);
|
||||
if($row)
|
||||
if($row) {
|
||||
if (!$row->delete()) {
|
||||
$errors[] = 'Fail during delete News.';
|
||||
}
|
||||
else
|
||||
}
|
||||
else {
|
||||
$errors[] = 'News with id ' . $id . ' does not exists.';
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
$errors[] = 'News id not set.';
|
||||
}
|
||||
|
||||
if(count($errors)) {
|
||||
return false;
|
||||
|
@@ -152,6 +152,10 @@ class Plugins {
|
||||
foreach(self::getAllPluginsJson() as $plugin) {
|
||||
if (isset($plugin['hooks'])) {
|
||||
foreach ($plugin['hooks'] as $_name => $info) {
|
||||
if (str_contains($info['type'], 'HOOK_')) {
|
||||
$info['type'] = str_replace('HOOK_', '', $info['type']);
|
||||
}
|
||||
|
||||
if (defined('HOOK_'. $info['type'])) {
|
||||
$hook = constant('HOOK_'. $info['type']);
|
||||
$hooks[] = ['name' => $_name, 'type' => $hook, 'file' => $info['file']];
|
||||
|
@@ -106,8 +106,8 @@ WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";');
|
||||
}
|
||||
$ret['templates'] = get_templates();
|
||||
|
||||
$ret['date_timezone'] = $config['date_timezone'];
|
||||
$ret['backward_support'] = $config['backward_support'];
|
||||
$ret['date_timezone'] = setting('core.date_timezone');
|
||||
$ret['backward_support'] = setting('core.backward_support');
|
||||
|
||||
$cache_engine = strtolower($config['cache_engine']);
|
||||
if($cache_engine == 'auto') {
|
||||
@@ -117,4 +117,4 @@ WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";');
|
||||
$ret['cache_engine'] = $cache_engine;
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user