Merge branch 'develop' into feature/new-router

# Conflicts:
#	composer.json
#	system/login.php
This commit is contained in:
slawkens 2023-02-03 07:31:39 +01:00
commit 11768424a3
199 changed files with 4166 additions and 1379 deletions

4
.gitignore vendored
View File

@ -24,6 +24,10 @@ templates/*
images/guilds/* images/guilds/*
!images/guilds/default.gif !images/guilds/default.gif
# editor images
images/editor/*
!images/editor/index.html
# cache # cache
system/cache/* system/cache/*
!system/cache/index.html !system/cache/index.html

View File

@ -9,6 +9,7 @@
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Logs Viewer'; $title = 'Logs Viewer';
$use_datatable = true;
$files = array(); $files = array();
$aac_path_logs = BASE . 'system/logs/'; $aac_path_logs = BASE . 'system/logs/';

View File

@ -9,6 +9,7 @@
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Pages'; $title = 'Pages';
$use_datatable = true;
if (!hasFlag(FLAG_CONTENT_PAGES) && !superAdmin()) { if (!hasFlag(FLAG_CONTENT_PAGES) && !superAdmin()) {
echo 'Access denied.'; echo 'Access denied.';

View File

@ -9,6 +9,7 @@
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Plugin manager'; $title = 'Plugin manager';
$use_datatable = true;
require_once LIBS . 'plugins.php'; require_once LIBS . 'plugins.php';

View File

@ -9,6 +9,7 @@
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Report Viewer'; $title = 'Report Viewer';
$use_datatable = true;
$files = array(); $files = array();
$server_path_reports = $config['data_path'] . 'reports/'; $server_path_reports = $config['data_path'] . 'reports/';

View File

@ -10,18 +10,24 @@
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Tools'; $title = 'Tools';
$tool = $_GET['tool']; if (!isset($_GET['tool'])) {
if (!isset($tool)) {
echo 'Tool not set.'; echo 'Tool not set.';
return; return;
} }
$tool = $_GET['tool'];
if (preg_match("/[^A-z0-9_\-]/", $tool)) { if (preg_match("/[^A-z0-9_\-]/", $tool)) {
echo 'Invalid tool.'; echo 'Invalid tool.';
return; return;
} }
$file = BASE . 'admin/pages/tools/' . $tool . '.php'; $file = SYSTEM . 'pages/admin/tools/' . $tool . '.php';
if (!@file_exists($file))
if (@file_exists($file)) {
require $file; require $file;
return;
}
echo 'Tool <strong>' . $tool . '</strong> not found.';
?> ?>

View File

@ -9,6 +9,7 @@
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Visitors'; $title = 'Visitors';
$use_datatable = true;
if (!$config['visitors_counter']): ?> if (!$config['visitors_counter']): ?>
Visitors counter is disabled.<br/> Visitors counter is disabled.<br/>

View File

@ -34,8 +34,10 @@ $menus = [
], ],
['name' => 'Tools', 'icon' => 'tools', 'order' => 100, 'link' => ['name' => 'Tools', 'icon' => 'tools', 'order' => 100, 'link' =>
[ [
['name' => 'Notepad', 'link' => 'notepad', 'order' => 10], ['name' => 'Mass Account Actions', 'link' => 'tools&tool=account', 'order' => 10],
['name' => 'phpinfo', 'link' => 'phpinfo', 'order' => 20], ['name' => 'Mass Teleport Actions', 'link' => 'tools&tool=teleport', 'order' => 20],
['name' => 'Notepad', 'link' => 'notepad', 'order' => 30],
['name' => 'phpinfo', 'link' => 'phpinfo', 'order' => 40],
], ],
], ],
['name' => 'Logs', 'icon' => 'bug', 'order' => 110, 'link' => ['name' => 'Logs', 'icon' => 'bug', 'order' => 110, 'link' =>

View File

@ -0,0 +1,53 @@
<?php
define('MYAAC_ADMIN', true);
require '../../common.php';
require SYSTEM . 'functions.php';
require SYSTEM . 'init.php';
require SYSTEM . 'login.php';
if(!admin())
die('Access denied.');
// Don't attempt to process the upload on an OPTIONS request
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
header('Access-Control-Allow-Methods: POST, OPTIONS');
return;
}
$imageFolder = BASE . EDITOR_IMAGES_DIR;
reset ($_FILES);
$temp = current($_FILES);
if (is_uploaded_file($temp['tmp_name'])) {
header('Access-Control-Allow-Credentials: true');
header('P3P: CP="There is no P3P policy."');
// Sanitize input
if (preg_match("/([^\w\s\d\-_~,;:\[\]\(\).])|([\.]{2,})/", $temp['name'])) {
header('HTTP/1.1 400 Invalid file name.');
return;
}
// Verify extension
$ext = strtolower(pathinfo($temp['name'], PATHINFO_EXTENSION));
if (!in_array($ext, ['gif', 'jpg', 'png'])) {
header('HTTP/1.1 400 Invalid extension.');
return;
}
do {
$randomName = generateRandomString(8). ".$ext";
$fileToWrite = $imageFolder . $randomName;
} while (file_exists($fileToWrite));
move_uploaded_file($temp['tmp_name'], $fileToWrite);
$returnPathToImage = BASE_URL . EDITOR_IMAGES_DIR . $randomName;
echo json_encode(['location' => $returnPathToImage]);
} else {
// Notify editor that the upload failed
header('HTTP/1.1 500 Server Error');
}

View File

@ -68,6 +68,12 @@ const TEMPLATES = BASE . 'templates/';
const TOOLS = BASE . 'tools/'; const TOOLS = BASE . 'tools/';
const VENDOR = BASE . 'vendor/'; const VENDOR = BASE . 'vendor/';
// other dirs
const SESSIONS_DIR = SYSTEM . 'php_sessions';
const GUILD_IMAGES_DIR = 'images/guilds/';
const EDITOR_IMAGES_DIR = 'images/editor/';
const GALLERY_DIR = 'images/gallery/';
// menu categories // menu categories
const MENU_CATEGORY_NEWS = 1; const MENU_CATEGORY_NEWS = 1;
const MENU_CATEGORY_ACCOUNT = 2; const MENU_CATEGORY_ACCOUNT = 2;
@ -87,9 +93,9 @@ const TFS_FIRST = TFS_02;
const TFS_LAST = TFS_03; const TFS_LAST = TFS_03;
// other definitions // other definitions
const ACCOUNT_NUMBER_LENGTH = 10; const ACCOUNT_NUMBER_LENGTH = 8;
session_save_path(SYSTEM . 'php_sessions'); session_save_path(SESSIONS_DIR);
session_start(); session_start();
// basedir // basedir
@ -99,7 +105,7 @@ $size = count($tmp) - 1;
for($i = 1; $i < $size; $i++) for($i = 1; $i < $size; $i++)
$basedir .= '/' . $tmp[$i]; $basedir .= '/' . $tmp[$i];
$basedir = str_replace(array('/admin', '/install'), '', $basedir); $basedir = str_replace(['/admin', '/install', '/tools'], '', $basedir);
define('BASE_DIR', $basedir); define('BASE_DIR', $basedir);
if(!IS_CLI) { if(!IS_CLI) {

View File

@ -8,7 +8,7 @@
"ext-dom": "*", "ext-dom": "*",
"phpmailer/phpmailer": "^6.1", "phpmailer/phpmailer": "^6.1",
"composer/semver": "^3.2", "composer/semver": "^3.2",
"twig/twig": "^1.0", "twig/twig": "^2.0",
"erusev/parsedown": "^1.7", "erusev/parsedown": "^1.7",
"nikic/fast-route": "^1.3" "nikic/fast-route": "^1.3"
} }

0
images/editor/index.html Normal file
View File

View File

@ -7,8 +7,8 @@ $dirs_required = [
'system/cache', 'system/cache',
]; ];
$dirs_optional = [ $dirs_optional = [
'images/guilds' => $locale['step_requirements_warning_images_guilds'], GUILD_IMAGES_DIR => $locale['step_requirements_warning_images_guilds'],
'images/gallery' => $locale['step_requirements_warning_images_gallery'], GALLERY_DIR => $locale['step_requirements_warning_images_gallery'],
]; ];
$extensions_required = [ $extensions_required = [

View File

@ -1,25 +1,29 @@
server { server {
listen 80; listen 80;
root /home/otserv/www/public; root /home/otserv/www/public;
index index.php; index index.php;
server_name your-domain.com; server_name your-domain.com;
location / { # increase max file upload
try_files $uri $uri/ /index.php; client_max_body_size 10M;
}
location ~ \.php$ { location / {
include snippets/fastcgi-php.conf; try_files $uri $uri/ /index.php;
fastcgi_read_timeout 240; }
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht { location ~ \.php$ {
deny all; include snippets/fastcgi-php.conf;
} fastcgi_read_timeout 240;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
# for ubuntu 22.04+ it will be php8.1-sock
}
location /system { location ~ /\.ht {
deny all; deny all;
return 404; }
}
} location /system {
deny all;
return 404;
}
}

View File

@ -1442,6 +1442,32 @@ function Outfits_loadfromXML()
return array('id' => $looktype, 'type' => $type, 'name' => $lookname, 'premium' => $premium, 'unlocked' => $unlocked, 'enabled' => $enabled); return array('id' => $looktype, 'type' => $type, 'name' => $lookname, 'premium' => $premium, 'unlocked' => $unlocked, 'enabled' => $enabled);
} }
function Mounts_loadfromXML()
{
global $config;
$file_path = $config['data_path'] . 'XML/mounts.xml';
if (!file_exists($file_path)) { return null; }
$xml = new DOMDocument;
$xml->load($file_path);
$mounts = null;
foreach ($xml->getElementsByTagName('mount') as $mount) {
$mounts[] = Mount_parseNode($mount);
}
return $mounts;
}
function Mount_parseNode($node) {
$id = (int)$node->getAttribute('id');
$clientid = (int)$node->getAttribute('clientid');
$name = $node->getAttribute('name');
$speed = (int)$node->getAttribute('speed');
$premium = $node->getAttribute('premium');
$type = $node->getAttribute('type');
return array('id' => $id, 'clientid' => $clientid, 'name' => $name, 'speed' => $speed, 'premium' => $premium, 'type' => $type);
}
function left($str, $length) { function left($str, $length) {
return substr($str, 0, $length); return substr($str, 0, $length);
} }

View File

@ -74,9 +74,7 @@ class Hook
}*/ }*/
global $db, $config, $template_path, $ots, $content, $twig; global $db, $config, $template_path, $ots, $content, $twig;
if(file_exists(BASE . $this->_file)) { $ret = include BASE . $this->_file;
$ret = require BASE . $this->_file;
}
return !isset($ret) || $ret == 1 || $ret; return !isset($ret) || $ret == 1 || $ret;
} }

View File

@ -11,7 +11,7 @@
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$configForumTablePrefix = config('forum_table_prefix'); $configForumTablePrefix = config('forum_table_prefix');
if(!empty(trim($configForumTablePrefix))) { if(null !== $configForumTablePrefix && !empty(trim($configForumTablePrefix))) {
if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) { if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) {
throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".'); throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".');
} }
@ -322,4 +322,4 @@ class Forum
return $hasAccess; return $hasAccess;
} }
} }
?> ?>

View File

@ -1091,6 +1091,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return Iterator List of players. * @return Iterator List of players.
*/ */
#[\ReturnTypeWillChange]
public function getIterator() public function getIterator()
{ {
return $this->getPlayersList(); return $this->getPlayersList();
@ -1105,7 +1106,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return int Count of players. * @return int Count of players.
*/ */
public function count() public function count(): int
{ {
return $this->getPlayersList()->count(); return $this->getPlayersList()->count();
} }

View File

@ -190,6 +190,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
* @version 0.1.3 * @version 0.1.3
* @return OTS_Base_DAO Current row. * @return OTS_Base_DAO Current row.
*/ */
#[\ReturnTypeWillChange]
public function current() public function current()
{ {
$id = current($this->rows); $id = current($this->rows);
@ -203,7 +204,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
* *
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
*/ */
public function rewind() public function rewind(): void
{ {
$this->rows = $this->db->query( $this->getSQL() )->fetchAll(); $this->rows = $this->db->query( $this->getSQL() )->fetchAll();
} }
@ -211,7 +212,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
/** /**
* Moves to next row. * Moves to next row.
*/ */
public function next() public function next(): void
{ {
next($this->rows); next($this->rows);
} }
@ -221,6 +222,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
* *
* @return mixed Array key. * @return mixed Array key.
*/ */
#[\ReturnTypeWillChange]
public function key() public function key()
{ {
return key($this->rows); return key($this->rows);
@ -231,7 +233,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
* *
* @return bool Does next row exist. * @return bool Does next row exist.
*/ */
public function valid() public function valid(): bool
{ {
return key($this->rows) !== null; return key($this->rows) !== null;
} }
@ -243,7 +245,7 @@ abstract class OTS_Base_List implements IOTS_DAO, Iterator, Countable
* @return int Number of rows. * @return int Number of rows.
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
*/ */
public function count() public function count(): int
{ {
return $this->db->query( $this->getSQL(true) )->fetchColumn(); return $this->db->query( $this->getSQL(true) )->fetchColumn();
} }

View File

@ -15,11 +15,11 @@
/** /**
* Container item representation. * Container item representation.
* *
* <p> * <p>
* This class represents items that can contain other items. It's {@link OTS_Container::count() count() method} has been overwritten so it now doesn't return count of current item (if it would even be possible for containers) but amount of items within (not recursively). * This class represents items that can contain other items. It's {@link OTS_Container::count() count() method} has been overwritten so it now doesn't return count of current item (if it would even be possible for containers) but amount of items within (not recursively).
* </p> * </p>
* *
* @package POT * @package POT
* @version 0.1.3 * @version 0.1.3
*/ */
@ -27,14 +27,14 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
{ {
/** /**
* Contained items. * Contained items.
* *
* @var array * @var array
*/ */
private $items = array(); private $items = array();
/** /**
* Adds item to container. * Adds item to container.
* *
* @param OTS_Item $item Item. * @param OTS_Item $item Item.
*/ */
public function addItem(OTS_Item $item) public function addItem(OTS_Item $item)
@ -44,11 +44,11 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
/** /**
* Removes given item from current container. * Removes given item from current container.
* *
* <p> * <p>
* Passed item must be exacly instance of item which is stored in container, not it's copy. This method bases on PHP references. * Passed item must be exacly instance of item which is stored in container, not it's copy. This method bases on PHP references.
* </p> * </p>
* *
* @param OTS_Item $item Item. * @param OTS_Item $item Item.
* @tutorial POT/Players.pkg#deleting * @tutorial POT/Players.pkg#deleting
*/ */
@ -66,14 +66,14 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
/** /**
* Number of items inside container. * Number of items inside container.
* *
* <p> * <p>
* OTS_Container implementation of Countable interface differs from {@link OTS_Item OTS_Item} implemention. {@link OTS_Item::count() OTS_Item::count()} returns count of given item, OTS_Container::count() returns number of items inside container. If somehow it would be possible to make container items with more then 1 in one place, you can use {@link OTS_Item::getCount() OTS_Item::getCount()} and {@link OTS_Item::setCount() OTS_Item::setCount()} in code where you are not sure if working with regular item, or container. * OTS_Container implementation of Countable interface differs from {@link OTS_Item OTS_Item} implemention. {@link OTS_Item::count() OTS_Item::count()} returns count of given item, OTS_Container::count() returns number of items inside container. If somehow it would be possible to make container items with more then 1 in one place, you can use {@link OTS_Item::getCount() OTS_Item::getCount()} and {@link OTS_Item::setCount() OTS_Item::setCount()} in code where you are not sure if working with regular item, or container.
* </p> * </p>
* *
* @return int Number of items. * @return int Number of items.
*/ */
public function count() public function count(): int
{ {
return count($items); return count($items);
} }
@ -123,7 +123,7 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
/** /**
* Returns iterator handle for loops. * Returns iterator handle for loops.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @return ArrayIterator Items iterator. * @return ArrayIterator Items iterator.
@ -135,7 +135,7 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
/** /**
* Clones all contained items. * Clones all contained items.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
*/ */

View File

@ -6,7 +6,7 @@ if (PHP_VERSION_ID >= 80000) {
/** /**
* @return PDOStatement * @return PDOStatement
*/ */
public function query(?string $query = null, ?int $fetchMode = null, mixed ...$fetchModeArgs) public function query(?string $query = null, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement
{ {
return $this->doQuery($query, $fetchMode, ...$fetchModeArgs); return $this->doQuery($query, $fetchMode, ...$fetchModeArgs);
} }

View File

@ -538,6 +538,7 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return Iterator List of players. * @return Iterator List of players.
*/ */
#[\ReturnTypeWillChange]
public function getIterator() public function getIterator()
{ {
return $this->getPlayersList(); return $this->getPlayersList();
@ -552,7 +553,7 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return int Count of players. * @return int Count of players.
*/ */
public function count() public function count(): int
{ {
return $this->getPlayersList()->count(); return $this->getPlayersList()->count();
} }

View File

@ -41,7 +41,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
$info['access'] = $group['name']; $info['access'] = $group['name'];
$this->groups[$group['id']] = new OTS_Group($info); $this->groups[$group['id']] = new OTS_Group($info);
} }
return; return;
} }
@ -50,7 +50,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
global $config; global $config;
$file = $config['data_path'] . 'XML/groups.xml'; $file = $config['data_path'] . 'XML/groups.xml';
} }
if(!@file_exists($file)) { if(!@file_exists($file)) {
error('Error: Cannot load groups.xml. More info in system/logs/error.log file.'); error('Error: Cannot load groups.xml. More info in system/logs/error.log file.');
log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). It doesnt exist.'); log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). It doesnt exist.');
@ -99,7 +99,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). Error: ' . print_r(error_get_last(), true)); log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). Error: ' . print_r(error_get_last(), true));
return; return;
} }
// loads groups // loads groups
foreach($groups->getElementsByTagName('group') as $group) foreach($groups->getElementsByTagName('group') as $group)
{ {
@ -157,7 +157,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
if($id > $group_id) if($id > $group_id)
$group_id = $id; $group_id = $id;
} }
return $group_id; return $group_id;
} }
@ -196,6 +196,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
* @since 0.1.5 * @since 0.1.5
* @return AppendIterator Iterator for all groups. * @return AppendIterator Iterator for all groups.
*/ */
#[\ReturnTypeWillChange]
public function getIterator() public function getIterator()
{ {
$iterator = new AppendIterator(); $iterator = new AppendIterator();
@ -210,7 +211,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
* @since 0.1.5 * @since 0.1.5
* @return int Amount of all groups. * @return int Amount of all groups.
*/ */
public function count() public function count(): int
{ {
return count($this->groups); return count($this->groups);
} }

View File

@ -709,6 +709,7 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return Iterator List of ranks. * @return Iterator List of ranks.
*/ */
#[\ReturnTypeWillChange]
public function getIterator() public function getIterator()
{ {
return $this->getGuildRanksList(); return $this->getGuildRanksList();
@ -723,7 +724,7 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return int Count of ranks. * @return int Count of ranks.
*/ */
public function count() public function count(): int
{ {
return $this->getGuildRanksList()->count(); return $this->getGuildRanksList()->count();
} }

View File

@ -396,6 +396,7 @@ class OTS_GuildRank extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return Iterator List of players. * @return Iterator List of players.
*/ */
#[\ReturnTypeWillChange]
public function getIterator() public function getIterator()
{ {
return $this->getPlayersList(); return $this->getPlayersList();
@ -410,7 +411,7 @@ class OTS_GuildRank extends OTS_Row_DAO implements IteratorAggregate, Countable
* @throws PDOException On PDO operation error. * @throws PDOException On PDO operation error.
* @return int Count of players. * @return int Count of players.
*/ */
public function count() public function count(): int
{ {
return $this->getPlayersList()->count(); return $this->getPlayersList()->count();
} }

View File

@ -15,7 +15,7 @@
/** /**
* Wrapper for houses list. * Wrapper for houses list.
* *
* @package POT * @package POT
* @version 0.1.3 * @version 0.1.3
* @tutorial POT/data_directory.pkg#towns.houses * @tutorial POT/data_directory.pkg#towns.houses
@ -24,14 +24,14 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
{ {
/** /**
* List of houses elements. * List of houses elements.
* *
* @var array * @var array
*/ */
private $houses = array(); private $houses = array();
/** /**
* Loads houses information. * Loads houses information.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $path Houses file. * @param string $path Houses file.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
@ -49,11 +49,11 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* <p> * <p>
* Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}. * Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}.
* </p> * </p>
* *
* @param array $properties List of object properties. * @param array $properties List of object properties.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
*/ */
@ -72,7 +72,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Checks if given house exists on list. * Checks if given house exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Name. * @param string $name Name.
@ -94,7 +94,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns house information. * Returns house information.
* *
* @version 0.1.3 * @version 0.1.3
* @param int $id House ID. * @param int $id House ID.
* @return OTS_House House information wrapper. * @return OTS_House House information wrapper.
@ -112,7 +112,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Checks if given house ID exists on list. * Checks if given house ID exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param int $id ID. * @param int $id ID.
@ -125,7 +125,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns ID of house with given name. * Returns ID of house with given name.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name House name. * @param string $name House name.
* @return int House ID. * @return int House ID.
@ -147,17 +147,17 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns amount of houses. * Returns amount of houses.
* *
* @return int Count of houses. * @return int Count of houses.
*/ */
public function count() public function count(): int
{ {
return count($this->houses); return count($this->houses);
} }
/** /**
* Returns iterator handle for loops. * Returns iterator handle for loops.
* *
* @return ArrayIterator Houses list iterator. * @return ArrayIterator Houses list iterator.
*/ */
public function getIterator() public function getIterator()
@ -167,7 +167,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Checks if given element exists. * Checks if given element exists.
* *
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @return bool True if it's set. * @return bool True if it's set.
*/ */
@ -185,7 +185,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns item from given position. * Returns item from given position.
* *
* @version 0.1.3 * @version 0.1.3
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @return OTS_House|int If key is an integer (type-sensitive!) then returns house instance. If it's a string then return associated ID found by house name. * @return OTS_House|int If key is an integer (type-sensitive!) then returns house instance. If it's a string then return associated ID found by house name.
@ -204,7 +204,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to houses list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to houses list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @param mixed $value Field value. * @param mixed $value Field value.
* @throws E_OTS_ReadOnly Always - this class is read-only. * @throws E_OTS_ReadOnly Always - this class is read-only.
@ -216,7 +216,7 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to houses list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to houses list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @throws E_OTS_ReadOnly Always - this class is read-only. * @throws E_OTS_ReadOnly Always - this class is read-only.
*/ */
@ -227,11 +227,11 @@ class OTS_HousesList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns string representation of object. * Returns string representation of object.
* *
* <p> * <p>
* If any display driver is currently loaded then it uses it's method. * If any display driver is currently loaded then it uses it's method.
* </p> * </p>
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @return string String representation of object. * @return string String representation of object.

View File

@ -15,11 +15,11 @@
/** /**
* Single item representation. * Single item representation.
* *
* <p> * <p>
* This class represents item that player has. It has no information about item feature, just it's handle in database. To get information about item type and it's features you have to use {@link OTS_ItemType OTS_ItemType class} - you can get it's object by calling {@link OTS_Item::getItemType() getItemType() method}, however you need to have global item types list loaded. * This class represents item that player has. It has no information about item feature, just it's handle in database. To get information about item type and it's features you have to use {@link OTS_ItemType OTS_ItemType class} - you can get it's object by calling {@link OTS_Item::getItemType() getItemType() method}, however you need to have global item types list loaded.
* </p> * </p>
* *
* @package POT * @package POT
* @version 0.1.0 * @version 0.1.0
* @property int $count Amount of item. * @property int $count Amount of item.
@ -31,28 +31,28 @@ class OTS_Item implements Countable
{ {
/** /**
* Item ID. * Item ID.
* *
* @var int * @var int
*/ */
private $id; private $id;
/** /**
* Item count. * Item count.
* *
* @var int * @var int
*/ */
private $count = 0; private $count = 0;
/** /**
* Additional attributes. * Additional attributes.
* *
* @var string * @var string
*/ */
private $attributes; private $attributes;
/** /**
* Creates item of given ID. * Creates item of given ID.
* *
* @param int $id Item ID. * @param int $id Item ID.
*/ */
public function __construct($id) public function __construct($id)
@ -62,7 +62,7 @@ class OTS_Item implements Countable
/** /**
* Returns item type. * Returns item type.
* *
* @return int Item ID. * @return int Item ID.
*/ */
public function getId() public function getId()
@ -72,7 +72,7 @@ class OTS_Item implements Countable
/** /**
* Returns count of item. * Returns count of item.
* *
* @return int Count of item. * @return int Count of item.
*/ */
public function getCount() public function getCount()
@ -82,7 +82,7 @@ class OTS_Item implements Countable
/** /**
* Sets count of item. * Sets count of item.
* *
* @param int $count Count. * @param int $count Count.
*/ */
public function setCount($count) public function setCount($count)
@ -92,7 +92,7 @@ class OTS_Item implements Countable
/** /**
* Returns item custom attributes. * Returns item custom attributes.
* *
* @return string Attributes. * @return string Attributes.
*/ */
public function getAttributes() public function getAttributes()
@ -102,7 +102,7 @@ class OTS_Item implements Countable
/** /**
* Sets item attributes. * Sets item attributes.
* *
* @param string $attributes Item Attributes. * @param string $attributes Item Attributes.
*/ */
public function setAttributes($attributes) public function setAttributes($attributes)
@ -112,7 +112,7 @@ class OTS_Item implements Countable
/** /**
* Returns type of item. * Returns type of item.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @return OTS_ItemType Returns item type of item (null if not exists). * @return OTS_ItemType Returns item type of item (null if not exists).
@ -125,17 +125,17 @@ class OTS_Item implements Countable
/** /**
* Count value for current item. * Count value for current item.
* *
* @return int Count of item. * @return int Count of item.
*/ */
public function count() public function count(): int
{ {
return $this->count; return $this->count;
} }
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string $name Property name. * @param string $name Property name.
@ -166,7 +166,7 @@ class OTS_Item implements Countable
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string $name Property name. * @param string $name Property name.

View File

@ -7,7 +7,7 @@
/** /**
* Code in this file bases on oryginal OTServ items loading C++ code (itemloader.h, items.cpp, items.h). * Code in this file bases on oryginal OTServ items loading C++ code (itemloader.h, items.cpp, items.h).
* *
* @package POT * @package POT
* @version 0.1.3 * @version 0.1.3
* @author Wrzasq <wrzasq@gmail.com> * @author Wrzasq <wrzasq@gmail.com>
@ -17,7 +17,7 @@
/** /**
* Items list loader. * Items list loader.
* *
* @package POT * @package POT
* @version 0.1.3 * @version 0.1.3
* @property-read int $otbVersion OTB file version. * @property-read int $otbVersion OTB file version.
@ -88,35 +88,35 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Temple positions. * Temple positions.
* *
* @var array * @var array
*/ */
private $items = array(); private $items = array();
/** /**
* OTB version. * OTB version.
* *
* @var int * @var int
*/ */
private $otbVersion; private $otbVersion;
/** /**
* Client version. * Client version.
* *
* @var int * @var int
*/ */
private $clientVersion; private $clientVersion;
/** /**
* Build version. * Build version.
* *
* @var int * @var int
*/ */
private $buildVersion; private $buildVersion;
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* <p> * <p>
* Allows object unserialisation. * Allows object unserialisation.
* </p> * </p>
@ -129,11 +129,11 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Loads items.xml and items.otb files. * Loads items.xml and items.otb files.
* *
* <p> * <p>
* This method loads both items.xml and items.otb files. Both of them has to be in given directory. * This method loads both items.xml and items.otb files. Both of them has to be in given directory.
* </p> * </p>
* *
* @version 0.1.3 * @version 0.1.3
* @param string $path Path to data/items directory. * @param string $path Path to data/items directory.
* @throws E_OTS_FileLoaderError When error occurs during file operation. * @throws E_OTS_FileLoaderError When error occurs during file operation.
@ -191,7 +191,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Parses loaded file. * Parses loaded file.
* *
* @version 0.1.0 * @version 0.1.0
* @throws E_OTS_FileLoaderError If file has invalid format. * @throws E_OTS_FileLoaderError If file has invalid format.
*/ */
@ -378,7 +378,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns OTB file version. * Returns OTB file version.
* *
* @return int OTB format version. * @return int OTB format version.
*/ */
public function getOTBVersion() public function getOTBVersion()
@ -388,7 +388,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns client version. * Returns client version.
* *
* @return int Client version. * @return int Client version.
*/ */
public function getClientVersion() public function getClientVersion()
@ -398,7 +398,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns build version. * Returns build version.
* *
* @return int Build version. * @return int Build version.
*/ */
public function getBuildVersion() public function getBuildVersion()
@ -408,7 +408,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Checks if given item type exists on list. * Checks if given item type exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Name. * @param string $name Name.
@ -430,7 +430,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns given item type. * Returns given item type.
* *
* @version 0.1.3 * @version 0.1.3
* @param int $id Item type (server) ID. * @param int $id Item type (server) ID.
* @return OTS_ItemType Returns item type of given ID. * @return OTS_ItemType Returns item type of given ID.
@ -448,7 +448,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Checks if given type ID exists on list. * Checks if given type ID exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param int $id ID. * @param int $id ID.
@ -461,11 +461,11 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Finds item type by it's name. * Finds item type by it's name.
* *
* <p> * <p>
* Note: If there are more then one items with same name this function will return first found server ID. It doesn't also mean that it will be the lowest ID - item types are ordered in order that they were loaded from items.xml file. * Note: If there are more then one items with same name this function will return first found server ID. It doesn't also mean that it will be the lowest ID - item types are ordered in order that they were loaded from items.xml file.
* </p> * </p>
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name Item type name. * @param string $name Item type name.
* @return int Returns item type (server) ID. * @return int Returns item type (server) ID.
@ -497,10 +497,10 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns amount of items loaded. * Returns amount of items loaded.
* *
* @return int Count of types. * @return int Count of types.
*/ */
public function count() public function count(): int
{ {
return count($this->items); return count($this->items);
} }
@ -550,7 +550,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns iterator handle for loops. * Returns iterator handle for loops.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @return ArrayIterator Items list iterator. * @return ArrayIterator Items list iterator.
@ -562,7 +562,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Checks if given element exists. * Checks if given element exists.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -582,7 +582,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns item from given position. * Returns item from given position.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -602,7 +602,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to items list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to items list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -616,7 +616,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to items list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to items list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -629,7 +629,7 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string $name Property name. * @param string $name Property name.
@ -652,11 +652,11 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
/** /**
* Returns string representation of object. * Returns string representation of object.
* *
* <p> * <p>
* If any display driver is currently loaded then it uses it's method. * If any display driver is currently loaded then it uses it's method.
* </p> * </p>
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @return string String representation of object. * @return string String representation of object.

View File

@ -163,7 +163,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
* *
* @return int Count of monsters. * @return int Count of monsters.
*/ */
public function count() public function count(): int
{ {
return count($this->monsters); return count($this->monsters);
} }

View File

@ -7,7 +7,7 @@
/** /**
* Code in this file bases on oryginal OTServ OTBM format loading C++ code (iomapotbm.h, iomapotbm.cpp). * Code in this file bases on oryginal OTServ OTBM format loading C++ code (iomapotbm.h, iomapotbm.cpp).
* *
* @package POT * @package POT
* @version 0.1.3 * @version 0.1.3
* @author Wrzasq <wrzasq@gmail.com> * @author Wrzasq <wrzasq@gmail.com>
@ -20,11 +20,11 @@
/** /**
* OTBM format reader. * OTBM format reader.
* *
* <p> * <p>
* POT OTBM file parser is less strict then oryginal OTServ one. For instance it will read waypoints from version 1 OTBM file even that there were no waypoints in that format. * POT OTBM file parser is less strict then oryginal OTServ one. For instance it will read waypoints from version 1 OTBM file even that there were no waypoints in that format.
* </p> * </p>
* *
* @package POT * @package POT
* @version 0.1.6 * @version 0.1.6
* @property-read OTS_HousesList $housesList Houses list loaded from associated houses file. * @property-read OTS_HousesList $housesList Houses list loaded from associated houses file.
@ -95,56 +95,56 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
const OTBM_ATTR_HOUSEDOORID = 14; const OTBM_ATTR_HOUSEDOORID = 14;
/** /**
* Amount. * Amount.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_ATTR_COUNT = 15; const OTBM_ATTR_COUNT = 15;
/** /**
* Time interval. * Time interval.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_ATTR_DURATION = 16; const OTBM_ATTR_DURATION = 16;
/** /**
* Metamorphic stage. * Metamorphic stage.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_ATTR_DECAYING_STATE = 17; const OTBM_ATTR_DECAYING_STATE = 17;
/** /**
* Date of being written. * Date of being written.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_ATTR_WRITTENDATE = 18; const OTBM_ATTR_WRITTENDATE = 18;
/** /**
* Sign author. * Sign author.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_ATTR_WRITTENBY = 19; const OTBM_ATTR_WRITTENBY = 19;
/** /**
* Sleeping player ID. * Sleeping player ID.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_ATTR_SLEEPERGUID = 20; const OTBM_ATTR_SLEEPERGUID = 20;
/** /**
* Time of sleep started. * Time of sleep started.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_ATTR_SLEEPSTART = 21; const OTBM_ATTR_SLEEPSTART = 21;
/** /**
* Number of charges. * Number of charges.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
@ -208,14 +208,14 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
const OTBM_NODE_HOUSETILE = 14; const OTBM_NODE_HOUSETILE = 14;
/** /**
* Waypoints list. * Waypoints list.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
const OTBM_NODE_WAYPOINTS = 15; const OTBM_NODE_WAYPOINTS = 15;
/** /**
* Waypoint. * Waypoint.
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
*/ */
@ -223,56 +223,56 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Map width. * Map width.
* *
* @var int * @var int
*/ */
private $width; private $width;
/** /**
* Map height. * Map height.
* *
* @var int * @var int
*/ */
private $height; private $height;
/** /**
* Map description. * Map description.
* *
* @var string * @var string
*/ */
private $description = ''; private $description = '';
/** /**
* List of towns. * List of towns.
* *
* @var array * @var array
*/ */
private $towns = array(); private $towns = array();
/** /**
* Temple positions. * Temple positions.
* *
* @var array * @var array
*/ */
private $temples = array(); private $temples = array();
/** /**
* Directory path. * Directory path.
* *
* @var string * @var string
*/ */
private $directory; private $directory;
/** /**
* External houses file. * External houses file.
* *
* @var OTS_HousesList * @var OTS_HousesList
*/ */
private $housesList; private $housesList;
/** /**
* List of map tracks. * List of map tracks.
* *
* @var array * @var array
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
@ -281,11 +281,11 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* <p> * <p>
* Allows object unserialisation. * Allows object unserialisation.
* </p> * </p>
* *
* @throws E_OTS_FileLoaderError When error occurs during file operation. * @throws E_OTS_FileLoaderError When error occurs during file operation.
*/ */
public function __wakeup() public function __wakeup()
@ -296,7 +296,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Loads OTBM file content. * Loads OTBM file content.
* *
* @version 0.1.0 * @version 0.1.0
* @param string $file Filename. * @param string $file Filename.
* @throws E_OTS_FileLoaderError When error occurs during file operation. * @throws E_OTS_FileLoaderError When error occurs during file operation.
@ -316,7 +316,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Parses loaded file. * Parses loaded file.
* *
* @version 0.1.0 * @version 0.1.0
* @throws E_OTS_FileLoaderError When error occurs during file operation. * @throws E_OTS_FileLoaderError When error occurs during file operation.
* @throws E_OTS_OutOfBuffer When there is read attemp after end of stream. * @throws E_OTS_OutOfBuffer When there is read attemp after end of stream.
@ -476,7 +476,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Loads map's houses list. * Loads map's houses list.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @return OTS_HousesList Houses from external file. * @return OTS_HousesList Houses from external file.
@ -488,7 +488,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns map width. * Returns map width.
* *
* @return int Map width. * @return int Map width.
*/ */
public function getWidth() public function getWidth()
@ -498,7 +498,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns map height. * Returns map height.
* *
* @return int Map height. * @return int Map height.
*/ */
public function getHeight() public function getHeight()
@ -508,7 +508,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns map description. * Returns map description.
* *
* @return string Map description. * @return string Map description.
*/ */
public function getDescription() public function getDescription()
@ -518,11 +518,11 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns map waypoints list. * Returns map waypoints list.
* *
* <p> * <p>
* Each item of returned array is sub-array with list of waypoints. * Each item of returned array is sub-array with list of waypoints.
* </p> * </p>
* *
* @version 0.1.6 * @version 0.1.6
* @since 0.1.6 * @since 0.1.6
* @return array List of tracks. * @return array List of tracks.
@ -534,7 +534,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Checks if given town ID exists on list. * Checks if given town ID exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param int $id ID. * @param int $id ID.
@ -547,7 +547,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns town's ID. * Returns town's ID.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name Town. * @param string $name Town.
* @return int ID. * @return int ID.
@ -567,7 +567,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Checks if given town name exists on list. * Checks if given town name exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Town. * @param string $name Town.
@ -580,7 +580,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns name of given town's ID. * Returns name of given town's ID.
* *
* @version 0.1.3 * @version 0.1.3
* @param int $id Town ID. * @param int $id Town ID.
* @return string Name. * @return string Name.
@ -607,7 +607,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns town's temple position. * Returns town's temple position.
* *
* @param int $id Town id. * @param int $id Town id.
* @return OTS_MapCoords|bool Point on map (false if not found). * @return OTS_MapCoords|bool Point on map (false if not found).
*/ */
@ -625,12 +625,12 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns amount of towns loaded. * Returns amount of towns loaded.
* *
* @version 0.0.8 * @version 0.0.8
* @since 0.0.8 * @since 0.0.8
* @return int Count of towns. * @return int Count of towns.
*/ */
public function count() public function count(): int
{ {
return count($this->towns); return count($this->towns);
} }
@ -690,7 +690,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns iterator handle for loops. * Returns iterator handle for loops.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @return ArrayIterator Towns list iterator. * @return ArrayIterator Towns list iterator.
@ -702,7 +702,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Checks if given element exists. * Checks if given element exists.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -724,7 +724,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns item from given position. * Returns item from given position.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -754,7 +754,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to towns list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to towns list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -768,7 +768,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to towns list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to towns list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string|int $offset Array key. * @param string|int $offset Array key.
@ -781,7 +781,7 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* @version 0.1.0 * @version 0.1.0
* @since 0.1.0 * @since 0.1.0
* @param string $name Property name. * @param string $name Property name.
@ -814,11 +814,11 @@ class OTS_OTBMFile extends OTS_FileLoader implements IteratorAggregate, Countabl
/** /**
* Returns string representation of object. * Returns string representation of object.
* *
* <p> * <p>
* If any display driver is currently loaded then it uses it's method. * If any display driver is currently loaded then it uses it's method.
* </p> * </p>
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @return string String representation of object. * @return string String representation of object.

View File

@ -324,7 +324,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
* @since 0.1.5 * @since 0.1.5
* @return int Amount of all spells. * @return int Amount of all spells.
*/ */
public function count() public function count(): int
{ {
return count($this->runes) + count($this->instants) + count($this->conjures); return count($this->runes) + count($this->instants) + count($this->conjures);
} }

View File

@ -15,7 +15,7 @@
/** /**
* Wrapper for vocations.xml file. * Wrapper for vocations.xml file.
* *
* @package POT * @package POT
* @version 0.1.3 * @version 0.1.3
* @example examples/vocations.php vocations.php * @example examples/vocations.php vocations.php
@ -25,14 +25,14 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
{ {
/** /**
* List of vocations. * List of vocations.
* *
* @var array * @var array
*/ */
private $vocations = array(); private $vocations = array();
/** /**
* Loads vocations list from given file. * Loads vocations list from given file.
* *
* @param string $file vocations.xml file location. * @param string $file vocations.xml file location.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
*/ */
@ -51,11 +51,11 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* <p> * <p>
* Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}. * Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}.
* </p> * </p>
* *
* @param array $properties List of object properties. * @param array $properties List of object properties.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
*/ */
@ -74,7 +74,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Checks if given vocation ID exists on list. * Checks if given vocation ID exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param int $id ID. * @param int $id ID.
@ -87,7 +87,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns vocation's ID. * Returns vocation's ID.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name Vocation. * @param string $name Vocation.
* @return int ID. * @return int ID.
@ -108,7 +108,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Checks if given vocation name exists on list. * Checks if given vocation name exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Vocation. * @param string $name Vocation.
@ -121,7 +121,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns name of given vocation's ID. * Returns name of given vocation's ID.
* *
* @version 0.1.3 * @version 0.1.3
* @param int $id Vocation ID. * @param int $id Vocation ID.
* @return string Name. * @return string Name.
@ -139,17 +139,17 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns amount of vocations loaded. * Returns amount of vocations loaded.
* *
* @return int Count of vocations. * @return int Count of vocations.
*/ */
public function count() public function count(): int
{ {
return count($this->vocations); return count($this->vocations);
} }
/** /**
* Returns iterator handle for loops. * Returns iterator handle for loops.
* *
* @return ArrayIterator Vocations list iterator. * @return ArrayIterator Vocations list iterator.
*/ */
public function getIterator() public function getIterator()
@ -159,7 +159,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Checks if given element exists. * Checks if given element exists.
* *
* @version 0.1.3 * @version 0.1.3
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @return bool True if it's set. * @return bool True if it's set.
@ -178,7 +178,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* Returns item from given position. * Returns item from given position.
* *
* @version 0.1.3 * @version 0.1.3
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @return string|int If key is an integer (type-sensitive!) then returns vocation name. If it's a string then return associated ID. * @return string|int If key is an integer (type-sensitive!) then returns vocation name. If it's a string then return associated ID.
@ -197,7 +197,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to vocations list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to vocations list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @param mixed $value Field value. * @param mixed $value Field value.
* @throws E_OTS_ReadOnly Always - this class is read-only. * @throws E_OTS_ReadOnly Always - this class is read-only.
@ -209,7 +209,7 @@ class OTS_VocationsList implements IteratorAggregate, Countable, ArrayAccess
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to vocations list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to vocations list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @throws E_OTS_ReadOnly Always - this class is read-only. * @throws E_OTS_ReadOnly Always - this class is read-only.
*/ */

View File

@ -59,18 +59,33 @@ if(!$logged && isset($_POST['account_login'], $_POST['password_login']))
$t = isset($tmp[$ip]) ? $tmp[$ip] : NULL; $t = isset($tmp[$ip]) ? $tmp[$ip] : NULL;
} }
if(config('recaptcha_enabled') && !config('account_create_auto_login'))
{
require_once LIBS . 'GoogleReCAPTCHA.php';
if (!GoogleReCAPTCHA::verify('login')) {
$errors[] = GoogleReCAPTCHA::getErrorMessage();
}
}
$account_logged = new OTS_Account(); $account_logged = new OTS_Account();
if(USE_ACCOUNT_NAME) if (config('account_login_by_email')) {
$account_logged->find($login_account); $account_logged->findByEMail($login_account);
else }
$account_logged->load($login_account, true);
if (!config('account_login_by_email') || config('account_login_by_email_fallback')) {
if(USE_ACCOUNT_NAME) {
$account_logged->find($login_account);
} else {
$account_logged->load($login_account, true);
}
}
$config_salt_enabled = $db->hasColumn('accounts', 'salt'); $config_salt_enabled = $db->hasColumn('accounts', 'salt');
if($account_logged->isLoaded() && encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password) == $account_logged->getPassword() if($account_logged->isLoaded() && encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password) == $account_logged->getPassword()
&& (!isset($t) || $t['attempts'] < 5) && (!isset($t) || $t['attempts'] < 5)
) )
{ {
setSession('account', $account_logged->getId()); setSession('account', $account_logged->getNumber());
setSession('password', encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password)); setSession('password', encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password));
if($remember_me) { if($remember_me) {
setSession('remember_me', true); setSession('remember_me', true);
@ -96,6 +111,8 @@ if(!$logged && isset($_POST['account_login'], $_POST['password_login']))
{ {
$hooks->trigger(HOOK_LOGIN_ATTEMPT, array('account' => $login_account, 'password' => $login_password, 'remember_me' => $remember_me)); $hooks->trigger(HOOK_LOGIN_ATTEMPT, array('account' => $login_account, 'password' => $login_password, 'remember_me' => $remember_me));
$errorMessage = getAccountLoginByLabel() . ' or password is not correct.';
// temporary solution for blocking failed login attempts // temporary solution for blocking failed login attempts
if($cache->enabled()) if($cache->enabled())
{ {
@ -107,24 +124,24 @@ if(!$logged && isset($_POST['account_login'], $_POST['password_login']))
if($t['attempts'] >= 5) if($t['attempts'] >= 5)
$errors[] = 'A wrong password has been entered 5 times in a row. You are unable to log into your account for the next 5 minutes. Please wait.'; $errors[] = 'A wrong password has been entered 5 times in a row. You are unable to log into your account for the next 5 minutes. Please wait.';
else else
$errors[] = 'Account name or password is not correct.'; $errors[] = $errorMessage;
} }
else else
{ {
$t = array('attempts' => 1, 'last' => time()); $t = array('attempts' => 1, 'last' => time());
$errors[] = 'Account name or password is not correct.'; $errors[] = $errorMessage;
} }
$tmp[$ip] = $t; $tmp[$ip] = $t;
$cache->set('failed_logins', serialize($tmp), 60 * 60); // save for 1 hour $cache->set('failed_logins', serialize($tmp), 60 * 60); // save for 1 hour
} }
else { else {
$errors[] = 'Account name or password is not correct.'; $errors[] = $errorMessage;
} }
} }
} }
else { else {
$errors[] = 'Please enter your account ' . (USE_ACCOUNT_NAME ? 'name' : 'number') . ' and password.'; $errors[] = 'Please enter your ' . getAccountLoginByLabel() . ' and password.';
$hooks->trigger(HOOK_LOGIN_ATTEMPT, array('account' => $login_account, 'password' => $login_password, 'remember_me' => $remember_me)); $hooks->trigger(HOOK_LOGIN_ATTEMPT, array('account' => $login_account, 'password' => $login_password, 'remember_me' => $remember_me));
} }

View File

@ -3,12 +3,12 @@
$db->query("RENAME TABLE $db->query("RENAME TABLE
" . TABLE_PREFIX . "screenshots TO " . TABLE_PREFIX . "gallery, " . TABLE_PREFIX . "screenshots TO " . TABLE_PREFIX . "gallery,
" . TABLE_PREFIX . "movies TO " . TABLE_PREFIX . "videos;"); " . TABLE_PREFIX . "movies TO " . TABLE_PREFIX . "videos;");
// rename images dir // rename images dir
if(file_exists(BASE . 'images/screenshots') && !file_exists(BASE .'images/gallery')) { if(file_exists(BASE . 'images/screenshots') && !file_exists(BASE . GALLERY_DIR)) {
rename(BASE . 'images/screenshots', BASE . 'images/gallery'); rename(BASE . 'images/screenshots', BASE . GALLERY_DIR);
} }
// convert old database screenshots images to gallery // convert old database screenshots images to gallery
$query = $db->query('SELECT `id`, `image`, `thumb` FROM `' . TABLE_PREFIX . 'gallery`;'); $query = $db->query('SELECT `id`, `image`, `thumb` FROM `' . TABLE_PREFIX . 'gallery`;');
foreach($query->fetchAll() as $item) { foreach($query->fetchAll() as $item) {
@ -17,4 +17,4 @@
'thumb' => str_replace('/screenshots/', '/gallery/', $item['thumb']), 'thumb' => str_replace('/screenshots/', '/gallery/', $item['thumb']),
), array('id' => $item['id'])); ), array('id' => $item['id']));
} }
?> ?>

View File

@ -74,7 +74,7 @@ if($save)
if(config('recaptcha_enabled')) if(config('recaptcha_enabled'))
{ {
require LIBS . 'GoogleReCAPTCHA.php'; require_once LIBS . 'GoogleReCAPTCHA.php';
if (!GoogleReCAPTCHA::verify('register')) { if (!GoogleReCAPTCHA::verify('register')) {
$errors['verification'] = GoogleReCAPTCHA::getErrorMessage(); $errors['verification'] = GoogleReCAPTCHA::getErrorMessage();
} }

View File

@ -0,0 +1,202 @@
<?php
/**
* Account Admin Tool
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @author Lee
* @copyright 2020 MyAAC
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Mass Account Actions';
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
$hasPointsColumn = $db->hasColumn('accounts', 'premium_points');
$freePremium = $config['lua']['freePremium'];
function admin_give_points($points)
{
global $db, $hasPointsColumn;
if (!$hasPointsColumn) {
error('Points not supported.');
return;
}
$statement = $db->prepare('UPDATE `accounts` SET `premium_points` = `premium_points` + :points');
if (!$statement) {
error('Failed to prepare query statement.');
return;
}
if (!$statement->execute([
'points' => $points
])) {
error('Failed to add points.');
return;
}
success($points . ' points added to all accounts.');
}
function admin_give_coins($coins)
{
global $db, $hasCoinsColumn;
if (!$hasCoinsColumn) {
error('Coins not supported.');
return;
}
$statement = $db->prepare('UPDATE `accounts` SET `coins` = `coins` + :coins');
if (!$statement) {
error('Failed to prepare query statement.');
return;
}
if (!$statement->execute([
'coins' => $coins
])) {
error('Failed to add coins.');
return;
}
success($coins . ' coins added to all accounts.');
}
function query_add_premium($column, $value_query, $condition_query = '1=1', $params = [])
{
global $db;
$statement = $db->prepare("UPDATE `accounts` SET `{$column}` = $value_query WHERE $condition_query");
if (!$statement) {
error('Failed to prepare query statement.');
return false;
}
if (!$statement->execute($params)) {
error('Failed to add premium days.');
return false;
}
return true;
}
function admin_give_premdays($days)
{
global $db, $freePremium;
if ($freePremium) {
error('Premium days not supported. Free Premium enabled.');
return;
}
$value = $days * 86400;
$now = time();
// othire
if ($db->hasColumn('accounts', 'premend')) {
// append premend
if (query_add_premium('premend', '`premend` + :value', '`premend` > :now', ['value' => $value, 'now' => $now])) {
// set premend
if (query_add_premium('premend', ':value', '`premend` <= :now', ['value' => $now + $value, 'now' => $now])) {
success($days . ' premium days added to all accounts.');
return;
} else {
error('Failed to execute set query.');
return;
}
} else {
error('Failed to execute append query.');
return;
}
return;
}
// tfs 0.x
if ($db->hasColumn('accounts', 'premdays')) {
// append premdays
if (query_add_premium('premdays', '`premdays` + :value', '1=1', ['value' => $days])) {
// append lastday
if (query_add_premium('lastday', '`lastday` + :value', '`lastday` > :now', ['value' => $value, 'now' => $now])) {
// set lastday
if (query_add_premium('lastday', ':value', '`lastday` <= :now', ['value' => $now + $value, 'now' => $now])) {
success($days . ' premium days added to all accounts.');
return;
} else {
error('Failed to execute set query.');
return;
}
success($days . ' premium days added to all accounts.');
return;
} else {
error('Failed to execute append query.');
return;
}
} else {
error('Failed to execute set days query.');
return;
}
return;
}
// tfs 1.x
if ($db->hasColumn('accounts', 'premium_ends_at')) {
// append premium_ends_at
if (query_add_premium('premium_ends_at', '`premium_ends_at` + :value', '`premium_ends_at` > :now', ['value' => $value, 'now' => $now])) {
// set premium_ends_at
if (query_add_premium('premium_ends_at', ':value', '`premium_ends_at` <= :now', ['value' => $now + $value, 'now' => $now])) {
success($days . ' premium days added to all accounts.');
return;
} else {
error('Failed to execute set query.');
return;
}
} else {
error('Failed to execute append query.');
return;
}
return;
}
error('Premium Days not supported.');
}
if (isset($_POST['action']) && $_POST['action']) {
$action = $_POST['action'];
if (preg_match("/[^A-z0-9_\-]/", $action)) {
error('Invalid action.');
} else {
$value = isset($_POST['value']) ? intval($_POST['value']) : 0;
if (!$value) {
error('Please fill all inputs');
} else {
switch ($action) {
case 'give-points':
admin_give_points($value);
break;
case 'give-coins':
admin_give_coins($value);
break;
case 'give-premdays':
admin_give_premdays($value);
break;
default:
error('Action ' . $action . 'not found.');
}
}
}
}
$twig->display('admin.tools.account.html.twig', array(
'hasCoinsColumn' => $hasCoinsColumn,
'hasPointsColumn' => $hasPointsColumn,
'freePremium' => $freePremium,
));

View File

@ -0,0 +1,100 @@
<?php
/**
* Teleport Admin Tool
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @author Lee
* @copyright 2020 MyAAC
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Mass Teleport Actions';
function admin_teleport_position($x, $y, $z) {
global $db;
$statement = $db->prepare('UPDATE `players` SET `posx` = :x, `posy` = :y, `posz` = :z');
if (!$statement) {
error('Failed to prepare query statement.');
return;
}
if (!$statement->execute([
'x' => $x, 'y' => $y, 'z' => $z
])) {
error('Failed to execute query.');
return;
}
success('Player\'s position updated.');
}
function admin_teleport_town($town_id) {
global $db;
$statement = $db->prepare('UPDATE `players` SET `town_id` = :town_id');
if (!$statement) {
error('Failed to prepare query statement.');
return;
}
if (!$statement->execute([
'town_id' => $town_id
])) {
error('Failed to execute query.');
return;
}
success('Player\'s town updated.');
}
if (isset($_POST['action']) && $_POST['action']) {
$action = $_POST['action'];
if (preg_match("/[^A-z0-9_\-]/", $action)) {
error('Invalid action.');
} else {
$playersOnline = 0;
if($db->hasTable('players_online')) {// tfs 1.0
$playersOnline = $db->query('SELECT count(*) FROM `players_online`');
} else {
$playersOnline = $db->query('SELECT count(*) FROM `players` WHERE `players`.`online` > 0');
}
if ($playersOnline > 0) {
error('Please, close the server before execute this action otherwise players will not be affected.');
return;
}
$town_id = isset($_POST['town_id']) ? intval($_POST['town_id']) : 0;
$posx = isset($_POST['posx']) ? intval($_POST['posx']) : 0;
$posy = isset($_POST['posy']) ? intval($_POST['posy']) : 0;
$posz = isset($_POST['posz']) ? intval($_POST['posz']) : 0;
switch ($action) {
case 'set-town':
if (!isset($config['towns'][$town_id])) {
error('Please fill all inputs');
return;
}
admin_teleport_town($value);
break;
case 'set-position':
if (!$posx || !$posy || !$posz) {
error('Please fill all inputs');
return;
}
admin_teleport_position($posx, $posy, $posz);
break;
default:
error('Action ' . $action . 'not found.');
}
}
}
$twig->display('admin.tools.teleport.html.twig', array());

View File

@ -145,8 +145,8 @@ class Gallery
$pathinfo = pathinfo($image); $pathinfo = pathinfo($image);
$extension = strtolower($pathinfo['extension']); $extension = strtolower($pathinfo['extension']);
$thumb_filename = 'images/gallery/' . $pathinfo['filename'] . '_thumb.' . $extension; $thumb_filename = GALLERY_DIR . $pathinfo['filename'] . '_thumb.' . $extension;
$filename = 'images/gallery/' . $pathinfo['filename'] . '.' . $extension; $filename = GALLERY_DIR . $pathinfo['filename'] . '.' . $extension;
if($db->insert(TABLE_PREFIX . 'gallery', array( if($db->insert(TABLE_PREFIX . 'gallery', array(
'comment' => $comment, 'comment' => $comment,
'image' => $filename, 'author' => $author, 'image' => $filename, 'author' => $author,
@ -172,7 +172,7 @@ class Gallery
$pathinfo = pathinfo($image); $pathinfo = pathinfo($image);
$extension = strtolower($pathinfo['extension']); $extension = strtolower($pathinfo['extension']);
$filename = 'images/gallery/' . $pathinfo['filename'] . '.' . $extension; $filename = GALLERY_DIR . $pathinfo['filename'] . '.' . $extension;
if($db->update(TABLE_PREFIX . 'gallery', array( if($db->update(TABLE_PREFIX . 'gallery', array(
'comment' => $comment, 'comment' => $comment,
@ -291,7 +291,7 @@ class Gallery
{ {
$pathinfo = pathinfo($file); $pathinfo = pathinfo($file);
$extension = strtolower($pathinfo['extension']); $extension = strtolower($pathinfo['extension']);
$thumb_filename = 'images/gallery/' . $pathinfo['filename'] . '_thumb.' . $extension; $thumb_filename = GALLERY_DIR . $pathinfo['filename'] . '_thumb.' . $extension;
if(!self::resize($file, 170, 110, $thumb_filename, $errors)) if(!self::resize($file, 170, 110, $thumb_filename, $errors))
return false; return false;

View File

@ -46,7 +46,7 @@ if(empty($errors)) {
$allowed_ext = array('image/gif', 'image/jpg', 'image/pjpeg', 'image/jpeg', 'image/bmp', 'image/png', 'image/x-png'); $allowed_ext = array('image/gif', 'image/jpg', 'image/pjpeg', 'image/jpeg', 'image/bmp', 'image/png', 'image/x-png');
$ext_name = array('image/gif' => 'gif', 'image/jpg' => 'jpg', 'image/jpeg' => 'jpg', 'image/pjpeg' => 'jpg', 'image/bmp' => 'bmp', 'image/png' => 'png', 'image/x-png' => 'png'); $ext_name = array('image/gif' => 'gif', 'image/jpg' => 'jpg', 'image/jpeg' => 'jpg', 'image/pjpeg' => 'jpg', 'image/bmp' => 'bmp', 'image/png' => 'png', 'image/x-png' => 'png');
$save_file_name = str_replace(' ', '_', strtolower($guild->getName())); $save_file_name = str_replace(' ', '_', strtolower($guild->getName()));
$save_path = 'images/guilds/' . $save_file_name; $save_path = GUILD_IMAGES_DIR . $save_file_name;
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save')
{ {
$file = $_FILES['newlogo']; $file = $_FILES['newlogo'];
@ -76,12 +76,12 @@ if(empty($errors)) {
{ {
$guild_logo = $guild->getCustomField('logo_name'); $guild_logo = $guild->getCustomField('logo_name');
$guild_logo = str_replace(array('..', '/', '\\'), array('','',''), $guild->getCustomField('logo_name')); $guild_logo = str_replace(array('..', '/', '\\'), array('','',''), $guild->getCustomField('logo_name'));
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) { if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo)) {
$guild_logo = "default.gif"; $guild_logo = "default.gif";
} }
if($guild_logo != "default.gif" && $guild_logo != $save_file_name.'.'.$extension) { if($guild_logo != "default.gif" && $guild_logo != $save_file_name.'.'.$extension) {
unlink('images/guilds/' . $guild_logo); unlink(GUILD_IMAGES_DIR . $guild_logo);
} }
} }
@ -96,7 +96,7 @@ if(empty($errors)) {
} }
$guild_logo = $guild->getCustomField('logo_name'); $guild_logo = $guild->getCustomField('logo_name');
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) { if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo)) {
$guild_logo = "default.gif"; $guild_logo = "default.gif";
} }

View File

@ -21,7 +21,7 @@ if(count($guilds_list) > 0)
{ {
foreach ($guilds_list as $guild) { foreach ($guilds_list as $guild) {
$guild_logo = $guild->getCustomField('logo_name'); $guild_logo = $guild->getCustomField('logo_name');
if (empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) if (empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo))
$guild_logo = "default.gif"; $guild_logo = "default.gif";
$description = $guild->getCustomField('description'); $description = $guild->getCustomField('description');
@ -38,4 +38,4 @@ $twig->display('guilds.list.html.twig', array(
'guilds' => $guilds, 'guilds' => $guilds,
'logged' => isset($logged) ? $logged : false, 'logged' => isset($logged) ? $logged : false,
'isAdmin' => admin(), 'isAdmin' => admin(),
)); ));

View File

@ -80,7 +80,7 @@ if($logged)
//show guild page //show guild page
$guild_logo = $guild->getCustomField('logo_name'); $guild_logo = $guild->getCustomField('logo_name');
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo))
$guild_logo = "default.gif"; $guild_logo = "default.gif";
$description = $guild->getCustomField('description'); $description = $guild->getCustomField('description');

View File

@ -1,34 +1,28 @@
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script> {{ include('tinymce.html.twig') }}
<script type="text/javascript"> <script type="text/javascript">
tinymce.init({ tinymceInit();
selector: "textarea",
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 emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
relative_urls: false,
remove_script_host: false,
document_base_url: "{{ constant('BASE_URL') }}"
});
</script> </script>
<div align="center" class="text-center"><p class="note">Sending mails may take some time if there are many users in db.</p></div> <div align="center" class="text-center"><p class="note">Sending mails may take some time if there are many users in db.</p></div>
<div class="card card-info card-outline"> <div class="card card-info card-outline">
<div class="card-header"> <div class="card-header">
<h5 class="m-0">Mailer</h5> <h5 class="m-0">Mailer</h5>
</div> </div>
<form method="post"> <form id="form" method="post">
<div class="card-body"> <div class="card-body">
<div class="form-group row"> <div class="form-group row">
<label for="mail_to">To: (enter email, or leave empty to all)</label> <label for="mail_to">To: (enter email, or leave empty to all)</label>
<input class="form-control" type="text" id="mail_to" name="mail_to" value="{{ mail_to }}"/> <input class="form-control" type="text" id="mail_to" name="mail_to" value="{{ mail_to }}"/>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="mail_subject">Subject:</label> <label for="mail_subject">Subject:</label>
<input class="form-control" type="text" id="mail_subject" name="mail_subject" value="{{ mail_subject }}" maxlength="30"/> <input class="form-control" type="text" id="mail_subject" name="mail_subject" value="{{ mail_subject }}" maxlength="30"/>
</div> </div>
<label for="editor" class="control-label">Content:</label>
<div class="form-group row"> <div class="form-group row">
<label for="mail_content" class="control-label">Content:</label> <textarea id="editor" name="mail_content" style="width: 100%" class="tinymce">{{ mail_content }}</textarea>
<textarea id="mail_content" name="mail_content" style="width: 100%" class="tinymce">{{ mail_content }}</textarea>
</div> </div>
</div> </div>
<div class="card-footer"> <div class="card-footer">

View File

@ -3,7 +3,7 @@
<div class="card-header"> <div class="card-header">
<h5 class="m-0">{% if action == 'edit' %}Edit{% else %}Add{% endif %} news</h5> <h5 class="m-0">{% if action == 'edit' %}Edit{% else %}Add{% endif %} news</h5>
</div> </div>
<form role="form" method="post" action="{{ news_link_form }}" id="news-edit-form"> <form id="form" role="form" method="post" action="{{ news_link_form }}">
<div class="card-body " id="page-edit-table"> <div class="card-body " id="page-edit-table">
{% if action == 'edit' %} {% if action == 'edit' %}
<input type="hidden" name="id" value="{{ news_id }}"/> <input type="hidden" name="id" value="{{ news_id }}"/>
@ -14,9 +14,9 @@
<input type="text" id="title" name="title" class="form-control" autocomplete="off" style="cursor: auto;" value="{{ title }}"> <input type="text" id="title" name="title" class="form-control" autocomplete="off" style="cursor: auto;" value="{{ title }}">
</div> </div>
<div class="form-group row"> <label for="editor">Content</label>
<label for="body">Content</label> <div class="form-group">
<textarea class="form-control" id="body" name="body" maxlength="65000" cols="50" rows="5">{{ body|raw }}</textarea> <textarea class="form-control" id="editor" name="body" maxlength="65000" cols="50" rows="5">{{ body|raw }}</textarea>
</div> </div>
<div class="form-group row"> <div class="form-group row">
@ -116,44 +116,8 @@
</script> </script>
{% endif %} {% endif %}
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script> {{ include('tinymce.html.twig') }}
<script type="text/javascript"> <script type="text/javascript">
let unsaved = false; tinymceInit();
let lastContent = '';
tinymce.init({
selector: "#body",
theme: "modern",
plugins: '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 emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
setup: function (ed) {
ed.on('NodeChange', function (e) {
if (ed.getContent() !== lastContent) {
unsaved = true;
}
});
}
});
$(document).ready(function () {
$(":input").change(function () { //triggers change in all input fields including text type
unsaved = true;
});
$("#news-edit-form").submit(function (event) {
unsaved = false;
});
lastContent = $("#body").val();
});
function unloadPage() {
if (unsaved) {
return "You have unsaved changes on this page. Do you want to leave this page and discard your changes or stay on this page?";
}
}
window.onbeforeunload = unloadPage;
</script> </script>
{% endif %} {% endif %}

View File

@ -3,8 +3,7 @@
<div class="card-header"> <div class="card-header">
<h5 class="m-0">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h5> <h5 class="m-0">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h5>
</div> </div>
<form class="form-horizontal" method="post" <form id="form" class="form-horizontal" method="post" action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
{% if action == 'edit' %} {% if action == 'edit' %}
<input type="hidden" name="id" value="{{ id }}"/> <input type="hidden" name="id" value="{{ id }}"/>
{% endif %} {% endif %}
@ -41,65 +40,51 @@
{% if not php %} {% if not php %}
<div class="form-group row"> <div class="form-group row">
<label for="enable_tinymce">Enable TinyMCE <label for="enable_tinymce">Enable TinyMCE
<input type="checkbox" id="enable_tinymce" name="enable_tinymce" <input type="checkbox" id="enable_tinymce" name="enable_tinymce" title="Check if you want to use TinyMCE Editor" value="1"{% if enable_tinymce %} checked{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
title="Check if you want to use TinyMCE Editor"
value="1"{% if enable_tinymce %} checked{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
{% if action == 'edit' %} {% if action == 'edit' %}
<input type="hidden" name="enable_tinymce" value="{% if enable_tinymce %}1{% else %}0{% endif %}"/> <input type="hidden" name="enable_tinymce" value="{% if enable_tinymce %}1{% else %}0{% endif %}"/>
{% endif %} {% endif %}
</label> </label>
</div> </div>
{% endif %} {% endif %}
<label for="editor">Content</label>
<div class="form-group row"> <div class="form-group row">
<label for="body">Content</label> <textarea class="form-control" id="editor" name="body" maxlength="65000" cols="50" rows="10">{{ body|raw }}</textarea>
<textarea class="form-control" id="body" name="body" maxlength="65000" cols="50"
rows="10">{{ body|raw }}</textarea>
</div> </div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<button type="submit" class="btn btn-info"><i class="fas fa-update"></i> Update</button> <button type="submit" class="btn btn-info"><i class="fas fa-update"></i> Update</button>
<button type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';" class="btn btn-danger float-right"><i class="fas fa-cancel"></i> Cancel</button> <button type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';" class="btn btn-danger float-right"><i class="fas fa-cancel"></i> Cancel</button>
</div> </div>
</form> </form>
</div> </div>
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script> {{ include('tinymce.html.twig') }}
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$('#enable_tinymce').on('change', function (e) { $('#enable_tinymce').on('change', function (e) {
if (!this.checked) { if (!this.checked) {
tinymce.remove('#body'); tinymce.remove('#editor');
} else { } else {
if (tinymce.editors.length > 0) { if (tinymce.get('#editor')!== null){
tinymce.activeEditor.show(); tinymce.activeEditor.show();
} else { } else {
init_tinymce(); tinymceInit();
} }
} }
}); });
{% if not php and enable_tinymce %} {% if not php and enable_tinymce %}
init_tinymce(); tinymceInit();
{% endif %} {% endif %}
function init_tinymce() {
tinymce.init({
selector: "#body",
theme: "modern",
plugins: 'code 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 emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
relative_urls: false,
remove_script_host: false,
document_base_url: "{{ constant('BASE_URL') }}"
});
}
function decodeHtml(html) { function decodeHtml(html) {
var txt = document.createElement("textarea"); var txt = document.createElement("textarea");
txt.innerHTML = html; txt.innerHTML = html;
return txt.value; return txt.value;
} }
}); });
</script> {% endif %} </script>
{% endif %}

View File

@ -0,0 +1,67 @@
<div class="row">
{% if hasPointsColumn %}
<div class="col-md-4">
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Give Premium Points</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=account">
<div class="card-body">
<div class="form-group">
<label>Premium Points</label>
<input type="number" name="value" value="" class="form-control">
</div>
</div>
<div class="card-footer">
<input type="hidden" name="action" value="give-points">
<button type="submit" class="btn btn-info">Add Points</button>
</div>
</form>
</div>
</div>
{% endif %}
{% if hasCoinsColumn %}
<div class="col-md-4">
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Give Coins</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=account">
<div class="card-body">
<div class="form-group">
<label>Coins</label>
<input type="number" name="value" value="" class="form-control">
</div>
</div>
<div class="card-footer">
<input type="hidden" name="action" value="give-coins">
<button type="submit" class="btn btn-info">Add Coins</button>
</div>
</form>
</div>
</div>
{% endif %}
{% if not freePremium %}
<div class="col-md-4">
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Give Premium Days</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=account">
<div class="card-body">
<div class="form-group">
<label>Premium Days</label>
<input type="number" name="value" value="" class="form-control">
</div>
</div>
<div class="card-footer">
<input type="hidden" name="action" value="give-premdays">
<button type="submit" class="btn btn-info">Add Days</button>
</div>
</form>
</div>
</div>
{% endif %}
</div>

View File

@ -0,0 +1,80 @@
<div class="row">
<div class="col-md-4">
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Set Town</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=teleport">
<div class="card-body">
<div class="form-group">
<label>Town</label>
<select name="value" class="form-control">
{% if config.towns|length > 0 %}
{% for town_id, town_name in config.towns %}
<option value="{{ town_id }}">{{ town_name }}</option>
{% endfor %}
{% else %}
<option disabled>No towns</option>
{% endif %}
</select>
</div>
</div>
<div class="card-footer">
<input type="hidden" name="action" value="set-town">
<button type="submit" class="btn btn-info">Set Town</button>
</div>
</form>
</div>
</div>
<div class="col-md-4">
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Set Position</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=teleport">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label>Position X</label>
<input type="number" name="posx" value="" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Position Y</label>
<input type="number" name="posy" value="" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Position Z</label>
<input type="number" name="posz" value="" class="form-control">
</div>
</div>
</div>
</div>
<div class="card-footer">
<input type="hidden" name="action" value="set-position">
<button type="submit" class="btn btn-info">Set Position</button>
</div>
</form>
</div>
</div>
<div class="col-md-4">
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Teleport to Temple</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=teleport">
<div class="card-footer">
<input type="hidden" name="action" value="set-position">
<input type="hidden" name="posx" value="0">
<input type="hidden" name="posy" value="0">
<input type="hidden" name="posz" value="0">
<button type="submit" class="btn btn-info">Teleport to Temple</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
<div style="text-align:center"><h2>Change guild logo</h2></div> <div style="text-align:center"><h2>Change guild logo</h2></div>
Here you can change logo of your guild.<br/>Actuall logo: <img src="images/guilds/{{ guild_logo }}" height="64" width="64"><br/><br/> Here you can change logo of your guild.<br/>Actuall logo: <img src="{{ constant('GUILD_IMAGES_DIR') }}{{ guild_logo }}" height="64" width="64"><br/><br/>
<form enctype="multipart/form-data" action="?subtopic=guilds&guild={{ guild.getName() }}&action=change_logo" method="post" id="upload_form"> <form enctype="multipart/form-data" action="?subtopic=guilds&guild={{ guild.getName() }}&action=change_logo" method="post" id="upload_form">
<input type="hidden" name="todo" value="save" /> <input type="hidden" name="todo" value="save" />
<input type="hidden" name="MAX_FILE_SIZE" value="{{ max_image_size_b }}" /> <input type="hidden" name="MAX_FILE_SIZE" value="{{ max_image_size_b }}" />

View File

@ -41,7 +41,7 @@
{% set i = i + 1 %} {% set i = i + 1 %}
<tr bgcolor="{{ getStyle(i) }}"> <tr bgcolor="{{ getStyle(i) }}">
<td> <td>
<img src="images/guilds/{{ guild.logo }}" width="64" height="64"> <img src="{{ constant('GUILD_IMAGES_DIR') }}{{ guild.logo }}" width="64" height="64">
</td> </td>
<td> <td>

View File

@ -5,13 +5,13 @@
<tbody> <tbody>
<tr> <tr>
<td width="64"> <td width="64">
<img src="images/guilds/{{ logo }}" width="64" height="64"> <img src="{{ constant('GUILD_IMAGES_DIR') }}{{ logo }}" width="64" height="64">
</td> </td>
<td align="center" width="100%"><h1>{{ guild_name }}</h1></td> <td align="center" width="100%"><h1>{{ guild_name }}</h1></td>
<td width="64"> <td width="64">
<img src="images/guilds/{{ logo }}" width="64" height="64"> <img src="{{ constant('GUILD_IMAGES_DIR') }}{{ logo }}" width="64" height="64">
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -17,5 +17,5 @@
</div> </div>
</noscript> </noscript>
{% if config.recaptcha_enabled %} {% if config.recaptcha_enabled %}
<script src="https://www.google.com/recaptcha/api.js{% if config('recaptcha_type') == 'v2-checkbox' %}?render={{ config.recaptcha_site_key }}{% endif %}"></script> <script src="https://www.google.com/recaptcha/api.js{% if config('recaptcha_type') == 'v3' %}?render={{ config.recaptcha_site_key }}{% endif %}"></script>
{% endif %} {% endif %}

View File

@ -0,0 +1,48 @@
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
let unsaved = false;
let lastContent = '';
function tinymceInit() {
tinymce.init({
selector: "#editor",
theme: "silver",
plugins: 'preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
images_upload_url: '{{ constant('BASE_URL') }}admin/tools/upload_image.php',
images_upload_credentials: true,
// not really sure - do we need those 3 options below?
//relative_urls: false,
//remove_script_host: false,
//document_base_url: "{{ constant('BASE_URL') }}"
setup: function (ed) {
ed.on('NodeChange', function (e) {
if (ed.getContent() !== lastContent) {
unsaved = true;
}
});
}
});
}
$(document).ready(function () {
$(":input").change(function () { //triggers change in all input fields including text type
unsaved = true;
});
$("#form").submit(function (event) {
unsaved = false;
});
lastContent = $("#editor").val();
});
function unloadPage() {
if (unsaved) {
return "You have unsaved changes on this page. Do you want to leave this page and discard your changes or stay on this page?";
}
}
window.onbeforeunload = unloadPage;
</script>

File diff suppressed because one or more lines are too long

View File

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,r)=>{const s="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(s,!1,!1===r?null:{"list-style-type":r})},r=t=>e=>e.options.get(t),s=r("advlist_number_styles"),n=r("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return i(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>i(t)&&/^(TH|TD)$/.test(t.nodeName),d=t=>l(t)||"default"===t?"":t,g=(t,e)=>r=>{const s=s=>{r.setActive(((t,e,r)=>{const s=((t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r]))return r;return-1})(e.parents,u),n=-1!==s?e.parents.slice(0,s):e.parents,l=o.grep(n,(t=>e=>i(e)&&/^(OL|UL|DL)$/.test(e.nodeName)&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))(t));return l.length>0&&l[0].nodeName===r})(t,s,e)),r.setEnabled(!((t,e)=>{const r=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&"false"===t.dom.getContentEditableParent(e))(t,r)})(t,s.element))};return t.on("NodeChange",s),()=>t.off("NodeChange",s)},h=(t,r,s,n,l,i)=>{i.length>1?((t,r,s,n,l,i)=>{t.ui.registry.addSplitButton(r,{tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(i,(t=>{const e="OL"===l?"num":"bull",r="disc"===t||"decimal"===t?"default":t,s=d(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:s,icon:"list-"+e+"-"+r,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(r,s)=>{e(t,l,s)},select:e=>{const r=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(e,"listStyleType");return a.from(r)})(t);return r.map((t=>e===t)).getOr(!1)},onSetup:g(t,l)})})(t,r,s,n,l,i):((t,r,s,n,l,i)=>{t.ui.registry.addToggleButton(r,{active:!1,tooltip:s,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:g(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,r,s,n,l,d(i[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{h(t,"numlist","Numbered list","InsertOrderedList","OL",s(t)),h(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((r,s)=>{e(t,"UL",s["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((r,s)=>{e(t,"OL",s["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),h=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),w=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),h);if(!w)return null;let v=w.container;const _=k.backwards(w.container,w.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),h),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(w.container,w.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=$.length&&b.substr(0,0+$.length)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),n=o("min_height"),s=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},a=(e,t,o,n)=>{var s;const i=parseInt(null!==(s=e.getStyle(t,o,n))&&void 0!==s?s:"",10);return isNaN(i)?0:i},g=(e,o,i)=>{var c;const u=e.dom,d=e.getDoc();if(!d)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const f=d.documentElement,m=r(e),p=null!==(c=n(e))&&void 0!==c?c:e.getElement().offsetHeight;let h=p;const v=a(u,f,"margin-top",!0),y=a(u,f,"margin-bottom",!0);let C=f.offsetHeight+v+y+m;C<0&&(C=0);const S=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+S>p&&(h=C+S);const z=s(e);if(z&&h>z?(h=z,l(e,!0)):l(e,!1),h!==o.get()){const n=h-o.get();if(u.setStyle(e.getContainer(),"height",h+"px"),o.set(h),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(i)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&n<0&&g(e,o,i)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const t=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{g(e,t)}))})(e,t),((e,t)=>{e.on("init",(()=>{const t=i(e),o=e.dom;o.setStyles(e.getDoc().documentElement,{height:"auto"}),o.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t,"min-height":0})})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(o=>{g(e,t,o)}))})(e,t)}}))}();

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),d=i("autosave_retention"),m=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},v=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},f=t=>{var e;const r=parseInt(null!==(e=a.getItem(m(t)+"time"))&&void 0!==e?e:"0",10)||0;return!((new Date).getTime()-r>d(t)&&(p(t,!1),1))},p=(t,e)=>{const r=m(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=m(t);!v(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{var e;const r=m(t);f(t)&&(t.setContent(null!==(e=a.getItem(r+"draft"))&&void 0!==e?e:"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{e.setEnabled(f(t));const r=()=>e.setEnabled(f(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const o=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:o},onSubmit:o=>{((e,o)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(o)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,o.getData().code),o.close()}})})(e)}))})(e),(e=>{const o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:o})})(e),{})))}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,o=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(o=r=t,(n=String).prototype.isPrototypeOf(o)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===n.name)?"string":e;var o,r,n,i})(t),r=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=(!1,()=>false);class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return n(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=(t,e)=>{for(let o=0,r=t.length;o<r;o++)e(t[o],o)},c=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},d=c,h=(t,e)=>{const o=t.dom;if(1!==o.nodeType)return!1;{const t=o;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const m=t=>e=>(t=>t.dom.nodeType)(e)===t,g=m(1),f=m(3),v=m(9),p=m(11),y=(t,e)=>{t.dom.removeAttribute(e)},w=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?t=>d(t.dom.getRootNode()):t=>v(t)?t:d(t.dom.ownerDocument),N=t=>d(t.dom.host),b=t=>{const e=f(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const o=e.ownerDocument;return(t=>{const e=w(t);return p(o=e)&&n(o.dom.host)?a.some(e):a.none();var o})(d(e)).fold((()=>o.body.contains(e)),(r=b,i=N,t=>r(i(t))));var r,i},S=t=>"rtl"===((t,e)=>{const o=t.dom,r=window.getComputedStyle(o).getPropertyValue(e);return""!==r||b(t)?r:((t,e)=>(t=>void 0!==t.style&&i(t.style.getPropertyValue))(t)?t.style.getPropertyValue(e):"")(o,e)})(t,"direction")?"rtl":"ltr",A=(t,e)=>((t,o)=>((t,e)=>{const o=[];for(let r=0,n=t.length;r<n;r++){const n=t[r];e(n,r)&&o.push(n)}return o})(((t,e)=>{const o=t.length,r=new Array(o);for(let n=0;n<o;n++){const o=t[n];r[n]=e(o,n)}return r})(t.dom.childNodes,d),(t=>h(t,e))))(t),T=("li",t=>g(t)&&"li"===t.dom.nodeName.toLowerCase());const C=(t,e)=>{const n=t.selection.getSelectedBlocks();n.length>0&&(u(n,(t=>{const n=d(t),c=T(n),m=((t,e)=>{return(e?(o=t,r="ol,ul",((t,e,o)=>{let n=t.dom;const s=i(o)?o:l;for(;n.parentNode;){n=n.parentNode;const t=d(n);if(h(t,r))return a.some(t);if(s(t))break}return a.none()})(o,0,n)):a.some(t)).getOr(t);var o,r,n})(n,c);var f;(f=m,(t=>a.from(t.dom.parentNode).map(d))(f).filter(g)).each((t=>{if(S(t)!==e?((t,e,n)=>{((t,e,n)=>{if(!(o(n)||r(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(m,"dir",e):S(m)!==e&&y(m,"dir"),c){const t=A(m,"li[dir]");u(t,(t=>y(t,"dir")))}}))})),t.nodeChanged())},D=(t,e)=>o=>{const r=t=>{const r=d(t.element);o.setActive(S(r)===e)};return t.on("NodeChange",r),()=>t.off("NodeChange",r)};t.add("directionality",(t=>{(t=>{t.addCommand("mceDirectionLTR",(()=>{C(t,"ltr")})),t.addCommand("mceDirectionRTL",(()=>{C(t,"rtl")}))})(t),(t=>{t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:D(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:D(t,"rtl")})})(t)}))}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||(null===(n=r.constructor)||void 0===n?void 0:n.name)===o.name)?"string":t;var s,r,o,n})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=("function",e=>"function"==typeof e);var c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");const p=e=>t=>t.options.get(e),u=p("importcss_merge_classes"),m=p("importcss_exclusive"),f=p("importcss_selector_converter"),y=p("importcss_selector_filter"),d=p("importcss_groups"),h=p("importcss_append"),_=p("importcss_file_filter"),g=p("skin"),v=p("skin_url"),b=Array.prototype.push,x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s={};const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=a.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),u(e)?s.classes=n:s.attributes={class:n},s},k=(e,t)=>null===t||m(e),w=e=>{e.on("init",(()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s<r;++s){if(!o(e[s]))throw new Error("Arr.flatten item "+s+" was not an array, input: "+e);b.apply(t,e[s])}return t})(((e,t)=>{const s=e.length,r=new Array(s);for(let o=0;o<s;o++){const s=e[o];r[o]=t(s,o)}return r})(r,n))).concat(e);var r,n}}})(),r={},n=T(y(e)),p=(e=>a.map(e,(e=>a.extend({},e,{original:e,selectors:{},filter:T(e.filter)}))))(d(e)),u=(t,s)=>{if(((e,t,s,r)=>!(k(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{k(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;const n=f(e);return o=r&&r.selector_converter?r.selector_converter:n||(()=>S(e,s)),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||c.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};a.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let p,u=t.href;if(u=(e=>{const t=l.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&(!r||r(u,n))&&!((e,t)=>{const s=g(e);if(s){const r=v(e),o=r?e.documentBaseURI.toAbsolute(r):i.baseURL+"/skins/ui/"+s,n=i.baseURL+"/skins/content/";return t===o+"/content"+(e.inline?".inline":"")+".min.css"||-1!==t.indexOf(n)}return!1})(e,u)){a.each(t.imports,(e=>{c(e,!0)}));try{p=t.cssRules||t.rules}catch(e){}a.each(p,(e=>{e.styleSheet?c(e.styleSheet,!0):e.selectorText&&a.each(e.selectorText.split(","),(e=>{o.push(a.trim(e))}))}))}};a.each(e.contentCSS,(e=>{n[e]=!0})),r||(r=(e,t)=>t||n[e]);try{a.each(t.styleSheets,(e=>{c(e)}))}catch(e){}return o})(e,e.getDoc(),T(_(e))),(e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>a.grep(e,(e=>!e.filter||e.filter(t))))(p,e);if(s.length>0)a.each(s,(s=>{const r=u(e,s);r&&t.addItemToGroup(s.title,r)}));else{const s=u(e,null);s&&t.addItem(s)}}}));const m=t.toFormats();e.dispatch("addStyleModifications",{items:m,replace:!h(e)})}))};e.add("importcss",(e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),w(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e))))}();

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),a=t("insertdatetime_dateformat"),r=t("insertdatetime_timeformat"),n=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length<t)for(let a=0;a<t-e.length;a++)e="0"+e;return e},d=(e,t,a=new Date)=>(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",c(a.getMonth()+1,2))).replace("%d",c(a.getDate(),2))).replace("%H",""+c(a.getHours(),2))).replace("%M",""+c(a.getMinutes(),2))).replace("%S",""+c(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[a.getMonth()]))).replace("%b",""+e.translate(l[a.getMonth()]))).replace("%A",""+e.translate(o[a.getDay()]))).replace("%a",""+e.translate(i[a.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)){const a=d(e,t);let r;r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const n=e.dom.getParent(e.selection.getStart(),"time");n?((e,t,a,r)=>{const n=e.dom.create("time",{datetime:a},r);e.dom.replace(n,t),e.selection.select(n,!0),e.selection.collapse(!1)})(e,n,r,a):e.insertContent('<time datetime="'+r+'">'+a+"</time>")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",(e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",((t,r)=>{u(e,null!=r?r:a(e))})),e.addCommand("mceInsertTime",((t,a)=>{u(e,null!=a?a:r(e))}))})(e),(e=>{const t=n(e),a=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=n(e);return t.length>0?t[0]:r(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:e=>e===a.get(),fetch:a=>{a(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(a.get())},onItemAction:(e,t)=>{a.set(t),s(t)}});const i=e=>()=>{a.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,(t=>({type:"menuitem",text:d(e,t),onAction:i(t)})))})})(e)}))}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,a=e("boolean"),o=e("number"),t=n=>e=>e.options.get(n),i=t("nonbreaking_force_tab"),r=t("nonbreaking_wrap"),s=(n,e)=>{let a="";for(let o=0;o<e;o++)a+=n;return a},c=(n,e)=>{const a=r(n)||n.plugins.visualchars?`<span class="${(n=>!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled())(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap"}" contenteditable="false">${s("&nbsp;",e)}</span>`:s("&nbsp;",e);n.undoManager.transact((()=>n.insertContent(a)))};var l=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",(n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>a(n)?{value:n?3:0,valid:!0}:o(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",(()=>{c(n,1)}))})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e})})(n),(n=>{const e=i(n);e>0&&n.on("keydown",(a=>{if(a.keyCode===l.TAB&&!a.isDefaultPrevented()){if(a.shiftKey)return;a.preventDefault(),a.stopImmediatePropagation(),c(n,e)}}))})(n)}))}();

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),r=t("pagebreak_separator"),n=t("pagebreak_split_block"),o="mce-pagebreak",s=e=>{const t=`<img src="${a.transparentSrc}" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />`;return e?`<p>${t}</p>`:t};e.add("pagebreak",(e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(s(n(e)))}))})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a})})(e),(e=>{const a=r(e),t=()=>n(e),c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(c,s(t()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(r=>{let n,s,c=r.length;for(;c--;)if(n=r[c],s=n.attr("class"),s&&-1!==s.indexOf(o)){const r=n.parent;if(r&&e.schema.getBlockElements()[r.name]&&t()){r.type=3,r.value=a,r.raw=!0,n.remove();continue}n.type=3,n.value=a,n.raw=!0}}))}))})(e),(e=>{e.on("ResolveName",(a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,o)&&(a.name="pagebreak")}))})(e)}))}();

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),i=n("content_style"),s=n("content_css_cors"),c=n("body_class"),r=n("body_id");e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{(e=>{const n=(e=>{var n;let l="";const a=e.dom.encode,d=null!==(n=i(e))&&void 0!==n?n:"";l+='<base href="'+a(e.documentBaseURI.getURI())+'">';const m=s(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{l+='<link type="text/css" rel="stylesheet" href="'+a(e.documentBaseURI.toAbsolute(t))+'"'+m+">"})),d&&(l+='<style type="text/css">'+d+"</style>");const y=r(e),u=c(e),v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(t.os.isMacOS()||t.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",p=e.getBody().dir,w=p?' dir="'+a(p)+'"':"";return"<!DOCTYPE html><html><head>"+l+'</head><body id="'+a(y)+'" class="mce-content-body '+a(u)+'"'+w+">"+e.getContent()+v+"</body></html>"})(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:n}}).focus("close")})(e)}))})(e),(e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})})(e)}))}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const n=("function",e=>"function"==typeof e);var o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools");const a=e=>n=>n.options.get(e),c=a("save_enablewhendirty"),i=a("save_onsavecallback"),s=a("save_oncancelcallback"),r=(e,n)=>{e.notificationManager.open({text:n,type:"error"})},l=e=>n=>{const o=()=>{n.setEnabled(!c(e)||e.isDirty())};return o(),e.on("NodeChange dirty",o),()=>e.off("NodeChange dirty",o)};e.add("save",(e=>{(e=>{const n=e.options.register;n("save_enablewhendirty",{processor:"boolean",default:!0}),n("save_onsavecallback",{processor:"function"}),n("save_oncancelcallback",{processor:"function"})})(e),(e=>{e.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>e.execCommand("mceSave"),onSetup:l(e)}),e.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>e.execCommand("mceCancel"),onSetup:l(e)}),e.addShortcut("Meta+S","","mceSave")})(e),(e=>{e.addCommand("mceSave",(()=>{(e=>{const t=o.DOM.getParent(e.id,"form");if(c(e)&&!e.isDirty())return;e.save();const a=i(e);if(n(a))return a.call(e,e),void e.nodeChanged();t?(e.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():r(e,"Error: Form submit field collision.")),e.nodeChanged()):r(e,"Error: No form element found.")})(e)})),e.addCommand("mceCancel",(()=>{(e=>{const o=t.trim(e.startContent),a=s(e);n(a)?a.call(e,e):e.resetContent(o)})(e)}))})(e)}))}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/**
* TinyMCE version 6.3.1 (2022-12-06)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(t,s,o)=>{t.dom.toggleClass(t.getBody(),"mce-visualblocks"),o.set(!o.get()),((t,s)=>{t.dispatch("VisualBlocks",{state:s})})(t,o.get())},o=("visualblocks_default_state",t=>t.options.get("visualblocks_default_state"));const e=(t,s)=>o=>{o.setActive(s.get());const e=t=>o.setActive(t.state);return t.on("VisualBlocks",e),()=>t.off("VisualBlocks",e)};t.add("visualblocks",((t,l)=>{(t=>{(0,t.options.register)("visualblocks_default_state",{processor:"boolean",default:!1})})(t);const a=(t=>{let s=!1;return{get:()=>s,set:t=>{s=t}}})();((t,o,e)=>{t.addCommand("mceVisualBlocks",(()=>{s(t,0,e)}))})(t,0,a),((t,s)=>{const o=()=>t.execCommand("mceVisualBlocks");t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:o,onSetup:e(t,s)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:o,onSetup:e(t,s)})})(t,a),((t,e,l)=>{t.on("PreviewFormats AfterPreviewFormats",(s=>{l.get()&&t.dom.toggleClass(t.getBody(),"mce-visualblocks","afterpreviewformats"===s.type)})),t.on("init",(()=>{o(t)&&s(t,0,l)}))})(t,0,a)}))}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
body{background-color:#222f3e;color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1 @@
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1 @@
@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1 @@
body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1 @@
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1 @@
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More