mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-17 04:48:40 +00:00
add design changes
This commit is contained in:
parent
255aca8536
commit
02d833f869
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\Admin\Admin\Install;
|
namespace Modules\Admin\Admin\Install;
|
||||||
|
|
||||||
use phpOMS\DataStorage\Database\DatabasePool;
|
use phpOMS\Application\ApplicationAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigation class.
|
* Navigation class.
|
||||||
|
|
@ -30,14 +30,14 @@ class Navigation
|
||||||
* Install navigation providing
|
* Install navigation providing
|
||||||
*
|
*
|
||||||
* @param string $path Module path
|
* @param string $path Module path
|
||||||
* @param DatabasePool $dbPool Database pool for database interaction
|
* @param ApplicationAbstract $app Application
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function install(string $path, DatabasePool $dbPool) : void
|
public static function install(string $path, ApplicationAbstract $app) : void
|
||||||
{
|
{
|
||||||
\Modules\Navigation\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Navigation.install.json']);
|
\Modules\Navigation\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Navigation.install.json']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,18 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'^.*/admin/settings/design(\?.*|$)' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\Admin\Controller\ApiController:apiSettingsDesignSet',
|
||||||
|
'verb' => RouteVerb::SET,
|
||||||
|
'permission' => [
|
||||||
|
'module' => ApiController::MODULE_NAME,
|
||||||
|
'type' => PermissionType::MODIFY,
|
||||||
|
'state' => PermissionState::SETTINGS,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
'^.*/admin/group$' => [
|
'^.*/admin/group$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Admin\Controller\ApiController:apiGroupCreate',
|
'dest' => '\Modules\Admin\Controller\ApiController:apiGroupCreate',
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ use Modules\Admin\Models\NullAccount;
|
||||||
use Modules\Admin\Models\PermissionState;
|
use Modules\Admin\Models\PermissionState;
|
||||||
use Modules\Media\Models\Collection;
|
use Modules\Media\Models\Collection;
|
||||||
use Modules\Media\Models\CollectionMapper;
|
use Modules\Media\Models\CollectionMapper;
|
||||||
|
use Modules\Media\Models\UploadFile;
|
||||||
use phpOMS\Account\AccountStatus;
|
use phpOMS\Account\AccountStatus;
|
||||||
use phpOMS\Account\AccountType;
|
use phpOMS\Account\AccountType;
|
||||||
use phpOMS\Account\GroupStatus;
|
use phpOMS\Account\GroupStatus;
|
||||||
|
|
@ -432,6 +433,34 @@ final class ApiController extends Controller
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Localization', 'Localization successfully modified', $l11n);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Localization', 'Localization successfully modified', $l11n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routing end-point for application behaviour.
|
||||||
|
*
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param mixed $data Generic data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function apiSettingsDesignSet(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
||||||
|
{
|
||||||
|
$uploadedFiles = $request->getFiles() ?? [];
|
||||||
|
|
||||||
|
if (!empty($uploadedFiles)) {
|
||||||
|
$upload = new UploadFile();
|
||||||
|
$upload->preserveFileName = false;
|
||||||
|
$upload->soutputDir = __DIR__ . '/../../../Web/Backend/img';
|
||||||
|
|
||||||
|
$status = $upload->upload($uploadedFiles, 'logo.png', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Design', 'Design successfully updated', []);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Api method to install a application
|
* Api method to install a application
|
||||||
*
|
*
|
||||||
|
|
@ -445,7 +474,7 @@ final class ApiController extends Controller
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function apiInstallApplication(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
public function apiInstallApplication(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
||||||
{
|
{
|
||||||
$appManager = new ApplicationManager($this->app->moduleManager);
|
$appManager = new ApplicationManager($this->app->moduleManager);
|
||||||
|
|
||||||
|
|
@ -461,7 +490,7 @@ final class ApiController extends Controller
|
||||||
$request->getData('theme') ?? 'Default'
|
$request->getData('theme') ?? 'Default'
|
||||||
);
|
);
|
||||||
|
|
||||||
self::apiActivateTheme($request, $response);
|
$this->apiActivateTheme($request, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -477,7 +506,7 @@ final class ApiController extends Controller
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function apiActivateTheme(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
public function apiActivateTheme(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
||||||
{
|
{
|
||||||
if (\is_dir(__DIR__ . '/../../../' . $request->getData('appDest') . '/css')) {
|
if (\is_dir(__DIR__ . '/../../../' . $request->getData('appDest') . '/css')) {
|
||||||
Directory::delete(__DIR__ . '/../../../' . $request->getData('appDest') . '/css');
|
Directory::delete(__DIR__ . '/../../../' . $request->getData('appDest') . '/css');
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
|
||||||
<li><label for="c-tab-1"><?= $this->getHtml('General'); ?></label></li>
|
<li><label for="c-tab-1"><?= $this->getHtml('General'); ?></label></li>
|
||||||
<li><label for="c-tab-2"><?= $this->getHtml('Localization'); ?></label></li>
|
<li><label for="c-tab-2"><?= $this->getHtml('Localization'); ?></label></li>
|
||||||
<li><label for="c-tab-3"><?= $this->getHtml('Settings'); ?></label></li>
|
<li><label for="c-tab-3"><?= $this->getHtml('Settings'); ?></label></li>
|
||||||
|
<li><label for="c-tab-4"><?= $this->getHtml('Design'); ?></label></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
|
|
@ -728,5 +729,41 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="radio" id="c-tab-4"
|
||||||
|
name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
|
||||||
|
<div class="tab">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-md-6">
|
||||||
|
<section class="portlet">
|
||||||
|
<div class="portlet-head"><?= $this->getHtml('Images'); ?></div>
|
||||||
|
<div class="portlet-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="iLoginImage"><?= $this->getHtml('LoginImage'); ?></label>
|
||||||
|
<div>
|
||||||
|
<img id="preview-loginImage"
|
||||||
|
alt="<?= $this->getHtml('LoginImage'); ?>"
|
||||||
|
itemprop="logo" loading="lazy"
|
||||||
|
src="<?= UriFactory::build('Web/Backend/img/logo.png'); ?>"
|
||||||
|
width="50px">
|
||||||
|
<div>
|
||||||
|
<a id="iLoginImageUploadButton" href="#upload" data-action='[
|
||||||
|
{"listener": "click", "key": 1, "action": [
|
||||||
|
{"key": 1, "type": "event.prevent"},
|
||||||
|
{"key": 2, "type": "dom.click", "selector": "#iLoginImageUpload"}
|
||||||
|
]}]'><?= $this->getHtml('Change'); ?></a>
|
||||||
|
<form id="iLoginImageUploadForm" action="<?= UriFactory::build('{/api}admin/settings/design'); ?>" method="post">
|
||||||
|
<input class="preview" data-action='[
|
||||||
|
{"listener": "change", "key": 1, "action": [
|
||||||
|
{"key": 1, "type": "form.submit", "selector": "#iLoginImageUploadForm"}
|
||||||
|
]}]' id="iLoginImageUpload" name="loginImage" type="file" accept="image/png" style="display: none;">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user