mirror of
https://github.com/flextype/flextype.git
synced 2025-08-13 00:24:15 +02:00
Flextype Box Plugin: Admin #125
This commit is contained in:
@@ -1,129 +0,0 @@
|
||||
<?php
|
||||
namespace Flextype;
|
||||
use Flextype\Component\{Http\Http, Registry\Registry, Filesystem\Filesystem, Token\Token, Number\Number};
|
||||
use function Flextype\Component\I18n\__;
|
||||
|
||||
Themes::view('admin/views/partials/head')->display();
|
||||
Themes::view('admin/views/partials/navbar')
|
||||
->assign('links', [
|
||||
'information' => [
|
||||
'link' => Http::getBaseUrl() . '/admin/information',
|
||||
'title' => __('admin_information'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
],
|
||||
])
|
||||
->display();
|
||||
Themes::view('admin/views/partials/content-start')->display();
|
||||
?>
|
||||
|
||||
<h3 class="h3"><?= __('admin_system') ?></h3>
|
||||
|
||||
<table class="table no-margin">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="200"><?= __('admin_flextype_version') ?></td>
|
||||
<td><?= Flextype::VERSION ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= __('admin_debugging'); ?></td>
|
||||
<td><?php if (Registry::get('settings.errors.display')) {
|
||||
echo __('admin_on');
|
||||
} else {
|
||||
echo __('admin_off');
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= __('admin_cache'); ?></td>
|
||||
<td><?php if (Registry::get('settings.cache.enabled')) {
|
||||
echo __('admin_on');
|
||||
} else {
|
||||
echo __('admin_off');
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br><br>
|
||||
|
||||
|
||||
<h3 class="h3"><?= __('admin_server'); ?></h3>
|
||||
|
||||
<table class="table no-margin">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="180"><?= __('admin_php_version') ?></td>
|
||||
<td><?= PHP_VERSION; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= __('admin_php_built_on') ?></td>
|
||||
<td><?= php_uname(); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= __('admin_web_server'); ?></td>
|
||||
<td><?= (isset($_SERVER['SERVER_SOFTWARE'])) ? $_SERVER['SERVER_SOFTWARE'] : @getenv('SERVER_SOFTWARE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= __('admin_web_server_php_interface') ?></td>
|
||||
<td><?= php_sapi_name() ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (function_exists('apache_get_modules')) {
|
||||
if (!in_array('mod_rewrite', apache_get_modules())) {
|
||||
echo '<tr><td>' . 'Apache Mod Rewrite' . '</td><td>' . __('admin_not_installed') . '</td></tr>';
|
||||
} else {
|
||||
echo '<tr><td>' . 'Apache Mod Rewrite' . '</td><td>' . __('admin_installed') . '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
echo '<tr><td>' . 'Apache Mod Rewrite' . '</td><td>' . __('admin_installed') . '</td></tr>';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!function_exists('password_hash')) {
|
||||
echo '<tr><td>' . 'password_hash()' . '</td><td>' . __('admin_not_installed') . '</td></tr>';
|
||||
} else {
|
||||
echo '<tr><td>' . 'password_hash()' . '</td><td>' . __('admin_installed') . '</td></tr>';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!function_exists('password_verify')) {
|
||||
echo '<tr><td>' . 'password_verify()' . '</td><td>' . __('admin_not_installed') . '</td></tr>';
|
||||
} else {
|
||||
echo '<tr><td>' . 'password_verify()' . '</td><td>' . __('admin_installed') . '</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php if (InformationManager::isFileWritable(ROOT_DIR . '/.htaccess') or
|
||||
InformationManager::isFileWritable(ROOT_DIR . '/index.php') or
|
||||
Registry::get('settings.errors.display') === true) { ?>
|
||||
|
||||
<h3 class="h3"><?= __('admin_security_check_results') ?></h3>
|
||||
|
||||
<table class="table no-margin">
|
||||
<tbody>
|
||||
<?php if (InformationManager::isFileWritable(ROOT_DIR . '/.htaccess')) { ?>
|
||||
<tr>
|
||||
<td><?= __('admin_security_check_results_htaccess', null, [':path' => ROOT_DIR . '/.htaccess']) ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (InformationManager::isFileWritable(ROOT_DIR . '/index.php')) { ?>
|
||||
<tr>
|
||||
<td><?= __('admin_security_check_results_index', null, [':path' => ROOT_DIR . '/index.php']) ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (Registry::get('settings.errors.display') === true) { ?>
|
||||
<tr>
|
||||
<td><?= __('admin_security_check_results_debug') ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br><br>
|
||||
<?php } ?>
|
||||
|
||||
<?php Themes::view('admin/views/partials/content-end')->display() ?>
|
||||
<?php Themes::view('admin/views/partials/footer')->display() ?>
|
@@ -1,260 +0,0 @@
|
||||
<?php
|
||||
namespace Flextype;
|
||||
use Flextype\Component\{Http\Http, Registry\Registry, Token\Token, Form\Form, Event\Event, Date\Date};
|
||||
use function Flextype\Component\I18n\__;
|
||||
|
||||
Themes::view('admin/views/partials/head')->display();
|
||||
Themes::view('admin/views/partials/navbar')
|
||||
->assign('links', [
|
||||
'settings' => [
|
||||
'link' => Http::getBaseUrl() . '/admin/settings',
|
||||
'title' => __('admin_settings'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
])
|
||||
->assign('buttons', [
|
||||
'save' => [
|
||||
'link' => 'javascript:;',
|
||||
'title' => __('admin_save'),
|
||||
'attributes' => ['class' => 'js-save-form-submit float-right btn']
|
||||
],
|
||||
'settings_clear_cache' => [
|
||||
'link' => Http::getBaseUrl() . '/admin/settings?clear_cache=1&token=' . Token::generate(),
|
||||
'title' => __('admin_clear_cache'),
|
||||
'attributes' => ['class' => 'float-right btn']
|
||||
]
|
||||
])
|
||||
->display();
|
||||
Themes::view('admin/views/partials/content-start')->display();
|
||||
?>
|
||||
|
||||
<?= Form::open(null, ['id' => 'form']) ?>
|
||||
<?= Form::hidden('token', Token::generate()) ?>
|
||||
<?= Form::hidden('action', 'save-form') ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<h3 class="h3"><?= __('admin_site'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('title', __('admin_site_title'), ['for' => 'systemSettingsSiteTitle']) ?>
|
||||
<?= Form::input('title', $settings['title'], ['class' => 'form-control', 'id' => 'systemSettingsSiteTitle', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('description', __('admin_site_description'), ['for' => 'systemSettingsSiteDescription']) ?>
|
||||
<?= Form::input('description', $settings['description'], ['class' => 'form-control margin-hard-bottom', 'id' => 'systemSettingsSiteDescription']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('keywords', __('admin_site_keywords'), ['for' => 'systemSettingsSiteKeywords']) ?>
|
||||
<?= Form::input('keywords', $settings['keywords'], ['class' => 'form-control', 'id' => 'systemSettingsSiteKeywords', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('robots', __('admin_site_robots'), ['for' => 'systemSettingsSiteRobots']) ?>
|
||||
<?= Form::input('robots', $settings['robots'], ['class' => 'form-control', 'id' => 'systemSettingsSiteRobots', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('author[name]', __('admin_author_name'), ['for' => 'systemSettingsSiteAuthorName']) ?>
|
||||
<?= Form::input('author[name]', $settings['author']['name'], ['class' => 'form-control', 'id' => 'systemSettingsSiteAuthorName', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('author[email]', __('admin_author_email'), ['for' => 'systemSettingsSiteAuthorEmail']) ?>
|
||||
<?= Form::input('author[email]', $settings['author']['email'], ['class' => 'form-control', 'id' => 'systemSettingsSiteAuthorEmail', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_general'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('timezone', __('admin_timezone'), ['for' => 'systemSettingsSystemTimezone']) ?>
|
||||
<?= Form::select('timezone', Date::timezones(), $settings['timezone'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTimezone', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('date_format', __('admin_date_format'), ['for' => 'systemSettingsSystemDateFormat']) ?>
|
||||
<?= Form::input('date_format', $settings['date_format'], ['class' => 'form-control', 'id' => 'systemSettingsSystemDateFormat', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('charset', __('admin_charset'), ['for' => 'systemSettingsSystemCharset']) ?>
|
||||
<?= Form::input('charset', $settings['charset'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCharset', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('theme', __('admin_theme'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::select('theme', $themes, $settings['theme'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('locale', __('admin_locale'), ['for' => 'systemSettingsSystemLocale']) ?>
|
||||
<?= Form::select('locale', $locales, $settings['locale'], ['class' => 'form-control', 'id' => 'entryTemplate']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[main]', __('admin_entry_main'), ['for' => 'systemSettingsSystemEntriesMain']) ?>
|
||||
<?= Form::select('entries[main]', $entries, $settings['entries']['main'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesMain', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_media'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][upload_images_quality]', __('admin_quality'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::input('entries[media][upload_images_quality]', $settings['entries']['media']['upload_images_quality'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][accept_file_types]', __('admin_accept_file_types'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::input('entries[media][accept_file_types]', $settings['entries']['media']['accept_file_types'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][upload_images_width]', __('admin_width'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::input('entries[media][upload_images_width]', $settings['entries']['media']['upload_images_width'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][upload_images_height]', __('admin_height'), ['for' => 'systemSettingsSystemEntriesMain']) ?>
|
||||
<?= Form::input('entries[media][upload_images_height]', $settings['entries']['media']['upload_images_height'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesMain', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_error_404_page'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[error404][title]', __('admin_error404_title'), ['for' => 'systemSettingsSystemEntriesError404Title']) ?>
|
||||
<?= Form::input('entries[error404][title]', $settings['entries']['error404']['title'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Title', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[error404][description]', __('admin_error404_description'), ['for' => 'systemSettingsSystemEntriesError404Description']) ?>
|
||||
<?= Form::input('entries[error404][description]', $settings['entries']['error404']['description'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Description', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[error404][content]', __('admin_error404_content'), ['for' => 'systemSettingsSystemEntriesError404Content']) ?>
|
||||
<?= Form::input('entries[error404][content]', $settings['entries']['error404']['content'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Content', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[error404][template]', __('admin_error404_template'), ['for' => 'systemSettingsSystemEntriesError404Template']) ?>
|
||||
<?= Form::input('entries[error404][template]', $settings['entries']['error404']['template'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Template', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_debugging'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('errors[display]', __('admin_errors_display'), ['for' => 'systemSettingsSystemErrorsDisplay']) ?>
|
||||
<?= Form::select('errors[display]', [0 => __('admin_disabled'), 1 => __('admin_enabled')], $settings['errors']['display'], ['class' => 'form-control', 'id' => 'systemSettingsSystemErrorsDisplay', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_cache'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[enabled]', __('admin_cache_enabled'), ['for' => 'systemSettingsSystemCacheEnabled']) ?>
|
||||
<?= Form::select('cache[enabled]', [0 => __('admin_disabled'), 1 => __('admin_enabled')], $settings['cache']['enabled'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheEnabled', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[prefix]', __('admin_cache_prefix'), ['for' => 'systemSettingsSystemCachePrefix']) ?>
|
||||
<?= Form::input('cache[prefix]', $settings['cache']['prefix'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCachePrefix', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[driver]', __('admin_cache_driver'), ['for' => 'systemSettingsSystemCacheDriver']) ?>
|
||||
<?= Form::select('cache[driver]', $cache_driver, $settings['cache']['driver'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheDriver', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[lifetime]', __('admin_cache_lifetime'), ['for' => 'systemSettingsSystemCacheLifetime']) ?>
|
||||
<?= Form::input('cache[lifetime]', $settings['cache']['lifetime'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheLifetime', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[memcached][server]', __('admin_memcached_server'), ['for' => 'systemSettingsSystemCacheMemcachedServer']) ?>
|
||||
<?= Form::input('cache[memcached][server]', $settings['cache']['memcached']['server'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheMemcachedServer', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[memcached][port]', __('admin_memcached_port'), ['for' => 'systemSettingsSystemCacheMemcachedPort']) ?>
|
||||
<?= Form::input('cache[memcached][port]', $settings['cache']['memcached']['port'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheMemcachedPort', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[redis][socket]', __('admin_redis_socket'), ['for' => 'systemSettingsSystemCacheRedisSocket']) ?>
|
||||
<?= Form::input('cache[redis][socket]', $settings['cache']['redis']['socket'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheRedisSocket', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[redis][password]', __('admin_redis_password'), ['for' => 'systemSettingsSystemCacheRedisPassword']) ?>
|
||||
<?= Form::input('cache[redis][password]', $settings['cache']['redis']['password'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheRedisPassword', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[redis][server]', __('admin_redis_server'), ['for' => 'systemSettingsSystemCacheRedisServer']) ?>
|
||||
<?= Form::input('cache[redis][server]', $settings['cache']['redis']['server'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheRedisServer', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[redis][port]', __('admin_redis_port'), ['for' => 'systemSettingsSystemCacheRedisPort']) ?>
|
||||
<?= Form::input('cache[redis][port]', $settings['cache']['redis']['port'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheRedisPort', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[sqlite3][database]', __('admin_sqlite3_database'), ['for' => 'systemSettingsSystemCacheSQLite3Database']) ?>
|
||||
<?= Form::input('cache[sqlite3][database]', $settings['cache']['sqlite3']['database'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheSQLite3Database', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[sqlite3][table]', __('admin_sqlite3_table'), ['for' => 'systemSettingsSystemCacheSQLite3Table']) ?>
|
||||
<?= Form::input('cache[sqlite3][table]', $settings['cache']['sqlite3']['table'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheSQLite3Table', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_admin_panel'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('admin_panel[theme]', __('admin_theme'), ['for' => 'systemSettingsSystemAdminPanelTheme']) ?>
|
||||
<?= Form::select('admin_panel[theme]', ['light' => __('admin_light'), 'dark' => __('admin_dark')], $settings['admin_panel']['theme'], ['class' => 'form-control', 'id' => 'systemSettingsSystemAdminPanelTheme', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= Form::close() ?>
|
||||
|
||||
<?php
|
||||
Themes::view('admin/views/partials/content-end')->display();
|
||||
Themes::view('admin/views/partials/footer')->display();
|
||||
?>
|
Reference in New Issue
Block a user