diff --git a/modules/Importer/Console/Commands/ImportFromClassicCommand.php b/app/Console/Commands/ImportFromClassicCommand.php
similarity index 92%
rename from modules/Importer/Console/Commands/ImportFromClassicCommand.php
rename to app/Console/Commands/ImportFromClassicCommand.php
index 97c73d82..7540e1c7 100644
--- a/modules/Importer/Console/Commands/ImportFromClassicCommand.php
+++ b/app/Console/Commands/ImportFromClassicCommand.php
@@ -1,10 +1,10 @@
increments('id');
+ $table->string('name');
+ $table->boolean('enabled')->default(1);
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('modules');
+ }
+}
diff --git a/app/Database/seeds/modules.yml b/app/Database/seeds/modules.yml
new file mode 100644
index 00000000..7e6eee56
--- /dev/null
+++ b/app/Database/seeds/modules.yml
@@ -0,0 +1,10 @@
+- name: 'Awards'
+ enabled: 1
+- name: 'Sample'
+ enabled: 1
+- name: 'VMSAcars'
+ enabled: 1
+- name: 'Vacentral'
+ enabled: 1
+- name: 'TestModule'
+ enabled: 1
diff --git a/app/Database/seeds/permissions.yml b/app/Database/seeds/permissions.yml
index 1e1b0f97..091d1bd7 100644
--- a/app/Database/seeds/permissions.yml
+++ b/app/Database/seeds/permissions.yml
@@ -51,3 +51,6 @@
- name: maintenance
display_name: Maintenance
description: Run maintenance tasks
+- name: modules
+ display_name: Modules
+ description: Add/Edit Modules
diff --git a/app/Exceptions/ModuleExistsException.php b/app/Exceptions/ModuleExistsException.php
new file mode 100644
index 00000000..9c311b74
--- /dev/null
+++ b/app/Exceptions/ModuleExistsException.php
@@ -0,0 +1,41 @@
+module_name = $module_name;
+ parent::__construct(
+ 409,
+ 'Module '.$module_name.' Already Exists!'
+ );
+ }
+
+ /**
+ * Return the RFC 7807 error type (without the URL root)
+ */
+ public function getErrorType(): string
+ {
+ return 'module-already-exists';
+ }
+
+ /**
+ * Get the detailed error string
+ */
+ public function getErrorDetails(): string
+ {
+ return $this->getMessage();
+ }
+
+ /**
+ * Return an array with the error details, merged with the RFC7807 response
+ */
+ public function getErrorMetadata(): array
+ {
+ return [];
+ }
+}
diff --git a/app/Exceptions/ModuleInstallationError.php b/app/Exceptions/ModuleInstallationError.php
new file mode 100644
index 00000000..5f03680e
--- /dev/null
+++ b/app/Exceptions/ModuleInstallationError.php
@@ -0,0 +1,38 @@
+getMessage();
+ }
+
+ /**
+ * Return an array with the error details, merged with the RFC7807 response
+ */
+ public function getErrorMetadata(): array
+ {
+ return [];
+ }
+}
diff --git a/app/Exceptions/ModuleInvalidFileType.php b/app/Exceptions/ModuleInvalidFileType.php
new file mode 100644
index 00000000..ba90c9e5
--- /dev/null
+++ b/app/Exceptions/ModuleInvalidFileType.php
@@ -0,0 +1,38 @@
+getMessage();
+ }
+
+ /**
+ * Return an array with the error details, merged with the RFC7807 response
+ */
+ public function getErrorMetadata(): array
+ {
+ return [];
+ }
+}
diff --git a/app/Http/Controllers/Admin/ModulesController.php b/app/Http/Controllers/Admin/ModulesController.php
new file mode 100644
index 00000000..318355a5
--- /dev/null
+++ b/app/Http/Controllers/Admin/ModulesController.php
@@ -0,0 +1,122 @@
+moduleSvc = $moduleSvc;
+ }
+
+ /**
+ * Display a listing of the Module.
+ *
+ * @return mixed
+ */
+ public function index()
+ {
+ $modules = $this->moduleSvc->getAllModules();
+ $new_modules = $this->moduleSvc->scan();
+ return view('admin.modules.index', [
+ 'modules' => $modules,
+ 'new_modules' => $new_modules,
+ ]);
+ }
+
+ /**
+ * Show the form for creating a new Module.
+ *
+ * @return Application|Factory|View
+ */
+ public function create()
+ {
+ return view('admin.modules.create');
+ }
+
+ /**
+ * Store a newly Uploaded Module in the Storage.
+ *
+ * @param Request $request
+ *
+ * @return Application|RedirectResponse|Redirector
+ */
+ public function store(Request $request)
+ {
+ $this->moduleSvc->installModule($request->file('module_file'));
+ return $this->index();
+ }
+
+ /**
+ * Show the form for editing the specified Module.
+ *
+ * @param $id
+ *
+ * @return Application|Factory|View
+ */
+ public function edit($id)
+ {
+ $module = $this->moduleSvc->getModule($id);
+ return view('admin.modules.edit', [
+ 'module' => $module,
+ ]);
+ }
+
+ /**
+ * Update the specified Module in storage.
+ *
+ * @param $id
+ * @param Request $request
+ *
+ * @return Application|RedirectResponse|Redirector
+ */
+ public function update($id, Request $request)
+ {
+ $this->moduleSvc->updateModule($id, $request->has('enabled'));
+ flash()->success('Module Status Changed!');
+ return redirect(route('admin.modules.index'));
+ }
+
+ /**
+ * Enabling Module Present in the Modules Folder
+ *
+ * @param Request $request
+ *
+ * @return Application|RedirectResponse|Redirector
+ */
+ public function enable(Request $request)
+ {
+ $this->moduleSvc->addModule($request->input('name'));
+ return redirect(route('admin.modules.index'));
+ }
+
+ /**
+ * Verify and Remove the specified Module from storage.
+ *
+ * @param mixed $id
+ * @param Request $request
+ *
+ * @return mixed
+ */
+ public function destroy($id, Request $request)
+ {
+ $delete = $this->moduleSvc->deleteModule($id, $request->all());
+ if ($delete == true) {
+ flash()->success('Module Deleted Successfully!');
+ return redirect(route('admin.modules.index'));
+ }
+ flash()->error('Verification Failed!');
+ return redirect(route('admin.modules.edit', $id));
+ }
+}
diff --git a/modules/Importer/Http/Controllers/ImporterController.php b/app/Http/Controllers/System/ImporterController.php
similarity index 78%
rename from modules/Importer/Http/Controllers/ImporterController.php
rename to app/Http/Controllers/System/ImporterController.php
index b499c645..e2fb76cf 100644
--- a/modules/Importer/Http/Controllers/ImporterController.php
+++ b/app/Http/Controllers/System/ImporterController.php
@@ -1,14 +1,14 @@
testDb($request);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
$status = 'danger';
$message = 'Failed! '.$e->getMessage();
}
- return view('importer::dbtest', [
+ return view('system.importer.dbtest', [
'status' => $status,
'message' => $message,
]);
@@ -76,7 +74,7 @@ class ImporterController extends Controller
/**
* The post from the above
*
- * @param \Illuminate\Http\Request $request
+ * @param Request $request
*
* @return mixed
*/
@@ -90,17 +88,17 @@ class ImporterController extends Controller
// Generate the import manifest
$manifest = $this->importerSvc->generateImportManifest();
- } catch (\Exception $e) {
+ } catch (Exception $e) {
Log::error($e->getMessage());
// Send it to run, step1
- return view('importer::error', [
+ return view('system.importer.error', [
'error' => $e->getMessage(),
]);
}
// Send it to run, step1
- return view('importer::step2-processing', [
+ return view('system.importer.step2-processing', [
'manifest' => $manifest,
]);
}
@@ -111,9 +109,9 @@ class ImporterController extends Controller
* stage=STAGE NAME
* start=record_start
*
- * @param \Illuminate\Http\Request $request
+ * @param Request $request
*
- * @throws \Exception
+ * @throws Exception
*
* @return mixed
*/
@@ -136,9 +134,6 @@ class ImporterController extends Controller
*/
public function complete()
{
- $installerSvc = app(InstallerService::class);
- $installerSvc->disableInstallerModules();
-
return redirect('/');
}
}
diff --git a/modules/Installer/Http/Controllers/InstallerController.php b/app/Http/Controllers/System/InstallerController.php
similarity index 83%
rename from modules/Installer/Http/Controllers/InstallerController.php
rename to app/Http/Controllers/System/InstallerController.php
index e24e6bff..2a816e10 100644
--- a/modules/Installer/Http/Controllers/InstallerController.php
+++ b/app/Http/Controllers/System/InstallerController.php
@@ -1,25 +1,32 @@
testDb($request);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
$status = 'danger';
$message = 'Failed! '.$e->getMessage();
}
- return view('installer::install/dbtest', [
+ return view('system.installer.install.dbtest', [
'status' => $status,
'message' => $message,
]);
@@ -132,11 +143,9 @@ class InstallerController extends Controller
/**
* Step 1. Check the modules and permissions
*
- * @param Request $request
- *
- * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+ * @return Factory|View
*/
- public function step1(Request $request)
+ public function step1()
{
$php_version = $this->reqSvc->checkPHPVersion();
$extensions = $this->reqSvc->checkExtensions();
@@ -150,9 +159,9 @@ class InstallerController extends Controller
];
// Make sure there are no false values
- $passed = !\in_array(false, $statuses, true);
+ $passed = !in_array(false, $statuses, true);
- return view('installer::install/steps/step1-requirements', [
+ return view('system.installer.install.steps.step1-requirements', [
'php' => $php_version,
'extensions' => $extensions,
'directories' => $directories,
@@ -163,14 +172,12 @@ class InstallerController extends Controller
/**
* Step 2. Database Setup
*
- * @param Request $request
- *
- * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+ * @return Factory|View
*/
- public function step2(Request $request)
+ public function step2()
{
$db_types = ['mysql' => 'mysql', 'sqlite' => 'sqlite'];
- return view('installer::install/steps/step2-db', [
+ return view('system.installer.install.steps.step2-db', [
'db_types' => $db_types,
]);
}
@@ -180,7 +187,7 @@ class InstallerController extends Controller
*
* @param Request $request
*
- * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+ * @return RedirectResponse|Redirector
*/
public function envsetup(Request $request)
{
@@ -192,7 +199,7 @@ class InstallerController extends Controller
// Before writing out the env file, test the DB credentials
try {
$this->testDb($request);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
Log::error('Testing db before writing configs failed');
Log::error($e->getMessage());
@@ -220,7 +227,7 @@ class InstallerController extends Controller
*/
try {
$this->envSvc->createConfigFiles($attrs);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
Log::error('Config files failed to write');
Log::error($e->getMessage());
@@ -236,11 +243,9 @@ class InstallerController extends Controller
/**
* Step 2b. Setup the database
*
- * @param Request $request
- *
* @return mixed
*/
- public function dbsetup(Request $request)
+ public function dbsetup()
{
$console_out = '';
@@ -250,7 +255,7 @@ class InstallerController extends Controller
$this->seederSvc->syncAllSeeds();
} catch (QueryException $e) {
Log::error('Error on db setup: '.$e->getMessage());
- dd($e);
+ //dd($e);
$this->envSvc->removeConfigFiles();
Flash::error($e->getMessage());
return redirect(route('installer.step2'))->withInput();
@@ -258,7 +263,7 @@ class InstallerController extends Controller
$console_out = trim($console_out);
- return view('installer::install/steps/step2a-db_output', [
+ return view('system.installer.install.steps.step2a-db_output', [
'console_output' => $console_out,
]);
}
@@ -266,9 +271,9 @@ class InstallerController extends Controller
/**
* Step 3. Setup the admin user and initial settings
*/
- public function step3(Request $request)
+ public function step3()
{
- return view('installer::install/steps/step3-user', [
+ return view('system.installer.install.steps.step3-user', [
'countries' => Countries::getSelectList(),
]);
}
@@ -278,9 +283,8 @@ class InstallerController extends Controller
*
* @param Request $request
*
- * @throws \RuntimeException
- * @throws \Prettus\Validator\Exceptions\ValidatorException
- * @throws \Exception
+ * @throws RuntimeException
+ * @throws Exception
*
* @return mixed
*/
@@ -337,21 +341,16 @@ class InstallerController extends Controller
// Try sending telemetry info
$this->analyticsSvc->sendInstall();
- return view('installer::install/steps/step3a-completed', []);
+ return view('system.installer.install.steps.step3a-completed', []);
}
/**
* Final step
*
- * @param Request $request
- *
- * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+ * @return RedirectResponse|Redirector
*/
- public function complete(Request $request)
+ public function complete()
{
- $installerSvc = app(InstallerService::class);
- $installerSvc->disableInstallerModules();
-
return redirect('/login');
}
}
diff --git a/modules/Updater/Http/Controllers/UpdateController.php b/app/Http/Controllers/System/UpdateController.php
similarity index 79%
rename from modules/Updater/Http/Controllers/UpdateController.php
rename to app/Http/Controllers/System/UpdateController.php
index df751bca..d042da6d 100644
--- a/modules/Updater/Http/Controllers/UpdateController.php
+++ b/app/Http/Controllers/System/UpdateController.php
@@ -1,6 +1,6 @@
installerSvc->clearCaches();
@@ -70,7 +70,7 @@ class UpdateController extends Controller
Log::info('Upgrade is pending');
}
- return view('updater::steps/step1-update-available');
+ return view('system.updater.steps.step1-update-available');
}
/**
@@ -87,13 +87,13 @@ class UpdateController extends Controller
$migrations = $this->migrationSvc->migrationsAvailable();
if (count($migrations) === 0) {
$this->seederSvc->syncAllSeeds();
- return view('updater::steps/step3-update-complete');
+ return view('system.updater.steps.step3-update-complete');
}
$output = $this->migrationSvc->runAllMigrations();
$this->seederSvc->syncAllSeeds();
- return view('updater::steps/step2-migrations-done', [
+ return view('system.updater.steps.step2-migrations-done', [
'console_output' => $output,
]);
}
@@ -101,11 +101,9 @@ class UpdateController extends Controller
/**
* Final step
*
- * @param Request $request
- *
* @return mixed
*/
- public function complete(Request $request)
+ public function complete()
{
return redirect('/login');
}
@@ -113,15 +111,13 @@ class UpdateController extends Controller
/**
* Show the update page with the latest version
*
- * @param \Illuminate\Http\Request $request
- *
- * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+ * @return Factory|View
*/
- public function updater(Request $request)
+ public function updater()
{
$version = $this->kvpRepo->get('latest_version_tag');
- return view('updater::downloader/downloader', [
+ return view('system.updater.downloader/downloader', [
'version' => $version,
]);
}
@@ -129,15 +125,13 @@ class UpdateController extends Controller
/**
* Download the actual update and then forward the user to the updater page
*
- * @param \Illuminate\Http\Request $request
- *
* @return mixed
*/
- public function update_download(Request $request)
+ public function update_download()
{
$version = $this->kvpRepo->get('latest_version_tag');
if (empty($version)) {
- return view('updater::steps/step1-no-update');
+ return view('system.updater.steps.step1-no-update');
}
$release = $this->updateManager->source('github')->fetch($version);
diff --git a/app/Models/Module.php b/app/Models/Module.php
new file mode 100644
index 00000000..6004aab4
--- /dev/null
+++ b/app/Models/Module.php
@@ -0,0 +1,28 @@
+ 'boolean',
+ ];
+
+ public static $rules = [
+ 'name' => 'required',
+ ];
+}
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 4197b62b..75363d22 100755
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -27,6 +27,74 @@ class RouteServiceProvider extends ServiceProvider
$this->mapWebRoutes();
$this->mapAdminRoutes();
$this->mapApiRoutes();
+ $this->mapImporterRoutes();
+ $this->mapInstallerRoutes();
+ $this->mapUpdaterRoutes();
+ }
+
+ private function mapImporterRoutes()
+ {
+ Route::group([
+ 'as' => 'importer.',
+ 'prefix' => 'importer',
+ 'middleware' => ['web'],
+ 'namespace' => 'App\Http\Controllers\System',
+ ], function () {
+ Route::get('/', 'ImporterController@index')->name('index');
+ Route::post('/config', 'ImporterController@config')->name('config');
+ Route::post('/dbtest', 'ImporterController@dbtest')->name('dbtest');
+
+ // Run the actual importer process. Additional middleware
+ Route::post('/run', 'ImporterController@run')->middleware('api')->name('run');
+ Route::post('/complete', 'ImporterController@complete')->name('complete');
+ });
+ }
+
+ private function mapInstallerRoutes()
+ {
+ Route::group([
+ 'as' => 'installer.',
+ 'prefix' => 'install',
+ 'middleware' => ['web'],
+ 'namespace' => 'App\Http\Controllers\System',
+ ], function () {
+ Route::get('/', 'InstallerController@index')->name('index');
+ Route::post('/dbtest', 'InstallerController@dbtest')->name('dbtest');
+
+ Route::get('/step1', 'InstallerController@step1')->name('step1');
+ Route::post('/step1', 'InstallerController@step1')->name('step1post');
+
+ Route::get('/step2', 'InstallerController@step2')->name('step2');
+ Route::post('/envsetup', 'InstallerController@envsetup')->name('envsetup');
+ Route::get('/dbsetup', 'InstallerController@dbsetup')->name('dbsetup');
+
+ Route::get('/step3', 'InstallerController@step3')->name('step3');
+ Route::post('/usersetup', 'InstallerController@usersetup')->name('usersetup');
+
+ Route::get('/complete', 'InstallerController@complete')->name('complete');
+ });
+ }
+
+ protected function mapUpdaterRoutes()
+ {
+ Route::group([
+ 'as' => 'update.',
+ 'prefix' => 'update',
+ 'middleware' => ['web', 'auth', 'ability:admin,admin-access'],
+ 'namespace' => 'App\Http\Controllers\System',
+ ], function () {
+ Route::get('/', 'UpdateController@index')->name('index');
+
+ Route::get('/step1', 'UpdateController@step1')->name('step1');
+ Route::post('/step1', 'UpdateController@step1')->name('step1post');
+
+ Route::post('/run-migrations', 'UpdateController@run_migrations')->name('run_migrations');
+ Route::get('/complete', 'UpdateController@complete')->name('complete');
+
+ // Routes for the update downloader
+ Route::get('/downloader', 'UpdateController@updater')->name('updater');
+ Route::post('/downloader', 'UpdateController@update_download')->name('update_download');
+ });
}
/**
@@ -41,7 +109,7 @@ class RouteServiceProvider extends ServiceProvider
Route::group([
'middleware' => ['web'],
'namespace' => $this->namespace,
- ], function ($router) {
+ ], function () {
Route::group([
'namespace' => 'Frontend',
'prefix' => '',
@@ -385,6 +453,35 @@ class RouteServiceProvider extends ServiceProvider
'delete',
], 'dashboard/news', ['uses' => 'DashboardController@news'])
->name('dashboard.news')->middleware('update_pending', 'ability:admin,admin-access');
+
+ //Modules
+ Route::group([
+ 'as' => 'modules.',
+ 'prefix' => 'modules',
+ 'middleware' => ['ability:admin, modules'],
+ ], function () {
+
+ //Modules Index
+ Route::get('/', 'ModulesController@index')->name('index');
+
+ //Add Module
+ Route::get('/create', 'ModulesController@create')->name('create');
+
+ //Store Module
+ Route::post('/create', 'ModulesController@store')->name('store');
+
+ //Enable Module
+ Route::post('/enable', 'ModulesController@enable')->name('enable');
+
+ //Edit Module
+ Route::get('/{id}/edit', 'ModulesController@edit')->name('edit');
+
+ //Update Module
+ Route::post('/{id}', 'ModulesController@update')->name('update');
+
+ //Delete Module
+ Route::delete('/{id}', 'ModulesController@destroy')->name('destroy');
+ });
});
}
@@ -402,7 +499,7 @@ class RouteServiceProvider extends ServiceProvider
'namespace' => $this->namespace.'\\Api',
'prefix' => 'api',
'as' => 'api.',
- ], function ($router) {
+ ], function () {
Route::group([], function () {
Route::get('acars', 'AcarsController@live_flights');
Route::get('acars/geojson', 'AcarsController@pireps_geojson');
diff --git a/modules/Importer/Services/ImporterService.php b/app/Services/ImporterService.php
similarity index 76%
rename from modules/Importer/Services/ImporterService.php
rename to app/Services/ImporterService.php
index 8a7dd770..fac8cae9 100644
--- a/modules/Importer/Services/ImporterService.php
+++ b/app/Services/ImporterService.php
@@ -1,25 +1,25 @@
importList as $importerKlass) {
- /** @var \Modules\Importer\Services\BaseImporter $importer */
+ /** @var BaseImporter $importer */
$importer = new $importerKlass();
$manifest = array_merge($manifest, $importer->getManifest());
}
@@ -130,11 +130,11 @@ class ImporterService extends Service
*/
public function run($importer, $start = 0)
{
- if (!in_array($importer, $this->importList)) {
+ if (!in_array($importer, $this->importList, true)) {
throw new Exception('Unknown importer "'.$importer.'"');
}
- /** @var $importerInst \Modules\Importer\Services\BaseImporter */
+ /** @var $importerInst BaseImporter */
$importerInst = new $importer();
try {
diff --git a/modules/Importer/Services/Importers/AircraftImporter.php b/app/Services/Importers/AircraftImporter.php
similarity index 92%
rename from modules/Importer/Services/Importers/AircraftImporter.php
rename to app/Services/Importers/AircraftImporter.php
index 7d937bc9..5afbf34c 100644
--- a/modules/Importer/Services/Importers/AircraftImporter.php
+++ b/app/Services/Importers/AircraftImporter.php
@@ -1,11 +1,10 @@
db->getColumns($this->table);
- if (in_array('airline', $columns)) {
+ if (in_array('airline', $columns, true)) {
$fields[] = 'airline';
}
- if (in_array('location', $columns)) {
+ if (in_array('location', $columns, true)) {
$fields[] = 'location';
}
diff --git a/modules/Importer/Services/Importers/AirlineImporter.php b/app/Services/Importers/AirlineImporter.php
similarity index 92%
rename from modules/Importer/Services/Importers/AirlineImporter.php
rename to app/Services/Importers/AirlineImporter.php
index 6b5bcc42..c0566e5e 100644
--- a/modules/Importer/Services/Importers/AirlineImporter.php
+++ b/app/Services/Importers/AirlineImporter.php
@@ -1,10 +1,9 @@
info('Imported '.$count.' airports');
+ return true;
}
}
diff --git a/modules/Importer/Services/BaseImporter.php b/app/Services/Importers/BaseImporter.php
similarity index 93%
rename from modules/Importer/Services/BaseImporter.php
rename to app/Services/Importers/BaseImporter.php
index 24fad2b7..c67222b2 100644
--- a/modules/Importer/Services/BaseImporter.php
+++ b/app/Services/Importers/BaseImporter.php
@@ -1,15 +1,16 @@
legacy_to_permission[$legacy_name];
if ($permName === 'admin') {
foreach ($permMappings as $name => $value) {
- if (!in_array($value, $permissions)) {
+ if (!in_array($value, $permissions, true)) {
$permissions[] = $value;
}
}
@@ -124,7 +123,7 @@ class GroupImporter extends BaseImporter
}
$permMapId = $permMappings[$permName];
- if (!in_array($permMapId, $permissions)) {
+ if (!in_array($permMapId, $permissions, true)) {
$permissions[] = $permMapId;
}
} catch (\Exception $e) {
diff --git a/modules/Importer/Services/Importers/LedgerImporter.php b/app/Services/Importers/LedgerImporter.php
similarity index 95%
rename from modules/Importer/Services/Importers/LedgerImporter.php
rename to app/Services/Importers/LedgerImporter.php
index eb4fd58e..9d11bd99 100644
--- a/modules/Importer/Services/Importers/LedgerImporter.php
+++ b/app/Services/Importers/LedgerImporter.php
@@ -1,11 +1,10 @@
db->getColumns($this->table);
- if (in_array('flightlevel', $columns)) {
+ if (in_array('flightlevel', $columns, true)) {
$fields[] = 'flightlevel';
}
@@ -144,7 +143,7 @@ class PirepImporter extends BaseImporter
];
$old_state = (int) $old_state;
- if (!in_array($old_state, $map)) {
+ if (!in_array($old_state, $map, true)) {
return PirepState::PENDING;
}
diff --git a/modules/Importer/Services/Importers/RankImport.php b/app/Services/Importers/RankImport.php
similarity index 91%
rename from modules/Importer/Services/Importers/RankImport.php
rename to app/Services/Importers/RankImport.php
index 209a6af7..d581e7e8 100644
--- a/modules/Importer/Services/Importers/RankImport.php
+++ b/app/Services/Importers/RankImport.php
@@ -1,9 +1,8 @@
disable();
-
- $module = Module::find('importer');
- $module->disable();
+ Artisan::call('optimize:clear');
}
}
diff --git a/modules/Installer/Services/RequirementsService.php b/app/Services/Installer/RequirementsService.php
similarity index 97%
rename from modules/Installer/Services/RequirementsService.php
rename to app/Services/Installer/RequirementsService.php
index 140614f4..1e45da6b 100644
--- a/modules/Installer/Services/RequirementsService.php
+++ b/app/Services/Installer/RequirementsService.php
@@ -1,6 +1,6 @@
moduleSeedsPending()) {
+ return true;
+ }
+
return false;
}
@@ -54,6 +59,7 @@ class SeederService extends Service
$this->syncAllYamlFileSeeds();
$this->syncAllSettings();
$this->syncAllPermissions();
+ $this->syncAllModules();
}
/**
@@ -83,6 +89,24 @@ class SeederService extends Service
});
}
+ public function syncAllModules(): void
+ {
+ $data = file_get_contents(database_path('/seeds/modules.yml'));
+ $yml = Yaml::parse($data);
+ foreach ($yml as $module) {
+ $module['updated_at'] = Carbon::now();
+ $count = DB::table('modules')->where('name', $module['name'])->count('name');
+ if ($count === 0) {
+ $module['created_at'] = Carbon::now();
+ DB::table('modules')->insert($module);
+ } else {
+ DB::table('modules')
+ ->where('name', $module['name'])
+ ->update($module);
+ }
+ }
+ }
+
public function syncAllSettings(): void
{
$data = file_get_contents(database_path('/seeds/settings.yml'));
@@ -286,4 +310,28 @@ class SeederService extends Service
return false;
}
+
+ private function moduleSeedsPending(): bool
+ {
+ $all_modules = DB::table('modules')->get();
+
+ $data = file_get_contents(database_path('/seeds/modules.yml'));
+ $yml = Yaml::parse($data);
+
+ foreach ($yml as $perm) {
+ $row = $all_modules->firstWhere('name', $perm['name']);
+ if (!$row) {
+ return true;
+ }
+
+ // See if any of these column values have changed
+ foreach (['name', 'enabled'] as $column) {
+ if ($row->{$column} !== $perm[$column]) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
}
diff --git a/app/Services/ModuleService.php b/app/Services/ModuleService.php
index 61f69f23..32f4a33e 100644
--- a/app/Services/ModuleService.php
+++ b/app/Services/ModuleService.php
@@ -3,6 +3,22 @@
namespace App\Services;
use App\Contracts\Service;
+use App\Exceptions\ModuleExistsException;
+use App\Exceptions\ModuleInstallationError;
+use App\Exceptions\ModuleInvalidFileType;
+use App\Models\Module;
+use Exception;
+use Illuminate\Filesystem\Filesystem;
+use Illuminate\Http\UploadedFile;
+use Illuminate\Support\Facades\Artisan;
+use Illuminate\Support\Facades\File;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Storage;
+use Illuminate\Support\Str;
+use Laracasts\Flash\FlashNotifier;
+use Madnest\Madzipper\Madzipper;
+use Nwidart\Modules\Json;
+use PharData;
class ModuleService extends Service
{
@@ -22,14 +38,14 @@ class ModuleService extends Service
* @param string $title
* @param string $url
* @param string $icon
- * @param mixed $logged_in
+ * @param bool $logged_in
*/
- public function addFrontendLink(string $title, string $url, string $icon = '', $logged_in = true)
+ public function addFrontendLink(string $title, string $url, string $icon = 'pe-7s-users', $logged_in = true)
{
self::$frontendLinks[$logged_in][] = [
'title' => $title,
'url' => $url,
- 'icon' => 'pe-7s-users',
+ 'icon' => $icon,
];
}
@@ -52,12 +68,12 @@ class ModuleService extends Service
* @param string $url
* @param string $icon
*/
- public function addAdminLink(string $title, string $url, string $icon = '')
+ public function addAdminLink(string $title, string $url, string $icon = 'pe-7s-users')
{
self::$adminLinks[] = [
'title' => $title,
'url' => $url,
- 'icon' => 'pe-7s-users',
+ 'icon' => $icon,
];
}
@@ -70,4 +86,217 @@ class ModuleService extends Service
{
return self::$adminLinks;
}
+
+ /**
+ * Get All modules from Database
+ *
+ * @return object
+ */
+ public function getAllModules(): object
+ {
+ return Module::all();
+ }
+
+ /**
+ * Get Module Information from Database.
+ *
+ * @param $id
+ *
+ * @return object
+ */
+ public function getModule($id): object
+ {
+ return Module::find($id);
+ }
+
+ /**
+ * Adding installed module to the database
+ *
+ * @param $module_name
+ *
+ * @return bool
+ */
+ public function addModule($module_name): bool
+ {
+ /*Check if module already exists*/
+ $module = Module::where('name', $module_name);
+ if (!$module->exists()) {
+ Module::create([
+ 'name' => $module_name,
+ 'enabled' => 1,
+ ]);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * User's uploaded file is passed into this method
+ * to install module in the Storage.
+ *
+ * @param UploadedFile $file
+ *
+ * @return FlashNotifier
+ */
+ public function installModule(UploadedFile $file): FlashNotifier
+ {
+ $file_ext = $file->getClientOriginalExtension();
+ $allowed_extensions = ['zip', 'tar', 'gz'];
+
+ if (!in_array($file_ext, $allowed_extensions, true)) {
+ throw new ModuleInvalidFileType();
+ }
+
+ $module = null;
+
+ $new_dir = rand();
+
+ File::makeDirectory(
+ storage_path('app/tmp/modules/'.$new_dir),
+ 0777,
+ true
+ );
+ $temp_ext_folder = storage_path('app/tmp/modules/'.$new_dir);
+ $temp = storage_path('app/tmp/modules/'.$new_dir);
+
+ $zipper = null;
+
+ if ($file_ext === 'tar' || $file_ext === 'gz') {
+ $zipper = new PharData($file);
+ $zipper->decompress();
+ }
+
+ if ($file_ext === 'zip') {
+ $madZipper = new Madzipper();
+
+ try {
+ $zipper = $madZipper->make($file);
+ } catch (Exception $e) {
+ throw new ModuleInstallationError();
+ }
+ }
+
+ try {
+ $zipper->extractTo($temp);
+ } catch (Exception $e) {
+ throw new ModuleInstallationError();
+ }
+
+ if (!File::exists($temp.'/module.json')) {
+ $directories = Storage::directories('tmp/modules/'.$new_dir);
+ $temp = storage_path('app/'.$directories[0]);
+ }
+
+ $json_file = $temp.'/module.json';
+
+ if (File::exists($json_file)) {
+ $json = json_decode(file_get_contents($json_file), true);
+ $module = $json['name'];
+ } else {
+ File::deleteDirectory($temp_ext_folder);
+ return flash()->error('Module Structure Not Correct!');
+ }
+
+ if (!$module) {
+ File::deleteDirectory($temp_ext_folder);
+ return flash()->error('Not a Valid Module File.');
+ }
+
+ $toCopy = base_path().'/modules/'.$module;
+
+ if (File::exists($toCopy)) {
+ File::deleteDirectory($temp_ext_folder);
+
+ throw new ModuleExistsException($module);
+ }
+
+ File::moveDirectory($temp, $toCopy);
+
+ File::deleteDirectory($temp_ext_folder);
+
+ try {
+ $this->addModule($module);
+ } catch (Exception $e) {
+ throw new ModuleExistsException($module);
+ }
+
+ Artisan::call('config:cache');
+ Artisan::call('module:migrate '.$module);
+
+ return flash()->success('Module Installed');
+ }
+
+ /**
+ * Update module with the status passed by user.
+ *
+ * @param $id
+ * @param $status
+ *
+ * @return bool
+ */
+ public function updateModule($id, $status): bool
+ {
+ $module = Module::find($id);
+ $module->update([
+ 'enabled' => $status,
+ ]);
+ return true;
+ }
+
+ /**
+ * Delete Module from the Storage & Database.
+ *
+ * @param $id
+ * @param $data
+ *
+ * @return bool
+ */
+ public function deleteModule($id, $data): bool
+ {
+ $module = Module::find($id);
+ if ($data['verify'] === strtoupper($module->name)) {
+ try {
+ $module->delete();
+ } catch (Exception $e) {
+ Log::emergency('Cannot Delete Module!');
+ }
+ $moduleDir = base_path().'/modules/'.$module->name;
+
+ try {
+ File::deleteDirectory($moduleDir);
+ } catch (Exception $e) {
+ Log::info('Folder Deleted Manually for Module : '.$module->name);
+ return true;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Get & scan all modules.
+ *
+ * @return array
+ */
+ public function scan()
+ {
+ $modules_path = base_path('modules/*');
+ $path = Str::endsWith($modules_path, '/*') ? $modules_path : Str::finish($modules_path, '/*');
+
+ $modules = [];
+
+ $manifests = (new Filesystem())->glob("{$path}/module.json");
+
+ is_array($manifests) || $manifests = [];
+
+ foreach ($manifests as $manifest) {
+ $name = Json::make($manifest)->get('name');
+ $module = Module::where('name', $name);
+ if (!$module->exists()) {
+ array_push($modules, $name);
+ }
+ }
+
+ return $modules;
+ }
}
diff --git a/app/Support/Modules/DatabaseActivator.php b/app/Support/Modules/DatabaseActivator.php
new file mode 100644
index 00000000..2f452bec
--- /dev/null
+++ b/app/Support/Modules/DatabaseActivator.php
@@ -0,0 +1,153 @@
+config = $app['config'];
+ $this->files = $app['files'];
+ $this->modulesStatuses = $this->getModulesStatuses();
+ $this->path = $path;
+ }
+
+ /**
+ * Get modules statuses, from the database
+ *
+ * @return array
+ */
+ private function getModulesStatuses(): array
+ {
+ try {
+ $modules = \App\Models\Module::all();
+ $retVal = [];
+ foreach ($modules as $i) {
+ $retVal[$i->name] = $i->enabled;
+ }
+ return $retVal;
+ } catch (Exception $e) {
+ return [];
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function reset(): void
+ {
+ (new \App\Models\Module())->truncate();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable(Module $module): void
+ {
+ $this->setActiveByName($module->getName(), true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable(Module $module): void
+ {
+ $this->setActiveByName($module->getName(), false);
+ }
+
+ /**
+ * \Nwidart\Modules\Module instance passed
+ * {@inheritdoc}
+ */
+ public function hasStatus(Module $module, bool $status): bool
+ {
+ try {
+ $module = (new \App\Models\Module())->where('name', $module->getName());
+ if ($module->exists()) {
+ return $module->first()->enabled == 1;
+ }
+ return false;
+ } catch (Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setActive(Module $module, bool $active): void
+ {
+ $this->setActiveByName($module->getName(), $active);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setActiveByName(string $name, bool $status): void
+ {
+ $module = (new \App\Models\Module())->where('name', $name);
+ if ($module->exists()) {
+ $module->update([
+ 'status' => $status,
+ ]);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete(Module $module): void
+ {
+ $name = $module->getName();
+
+ try {
+ (new \App\Models\Module())->where([
+ 'name' => $name,
+ ])->delete();
+ } catch (Exception $e) {
+ Log::error('Module '.$module.' Delete failed! Exception : '.$e->getMessage());
+ return;
+ }
+ }
+}
diff --git a/modules/Updater/Lib/VmsRepositoryType.php b/app/Support/VmsRepositoryType.php
similarity index 96%
rename from modules/Updater/Lib/VmsRepositoryType.php
rename to app/Support/VmsRepositoryType.php
index 825a6ec0..f37d6337 100644
--- a/modules/Updater/Lib/VmsRepositoryType.php
+++ b/app/Support/VmsRepositoryType.php
@@ -1,16 +1,18 @@
=7.2.5"
},
"require-dev": {
- "illuminate/database": "^6.0|^7.0",
+ "illuminate/database": "^6.0|^7.0|^8.0",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~7.1"
},
@@ -2989,7 +2989,7 @@
],
"description": "HTML and Form Builders for the Laravel Framework",
"homepage": "https://laravelcollective.com",
- "time": "2020-05-19T18:02:16+00:00"
+ "time": "2020-09-07T19:59:40+00:00"
},
{
"name": "layershifter/tld-database",
@@ -3575,6 +3575,63 @@
],
"time": "2020-08-09T10:34:01+00:00"
},
+ {
+ "name": "madnest/madzipper",
+ "version": "v1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/madnest/madzipper.git",
+ "reference": "c9ee808506a5d53e28876580f98d57717e9b80af"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/madnest/madzipper/zipball/c9ee808506a5d53e28876580f98d57717e9b80af",
+ "reference": "c9ee808506a5d53e28876580f98d57717e9b80af",
+ "shasum": ""
+ },
+ "require": {
+ "ext-zip": "*",
+ "illuminate/filesystem": "^6.18|^7.0|^8.0",
+ "illuminate/support": "^6.18|^7.0|^8.0",
+ "laravel/framework": "~7.0|~8.0",
+ "php": ">=7.2.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^1.3",
+ "orchestra/testbench": "^5.1",
+ "phpunit/phpunit": "^8.0|^9.0"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "Madnest\\Madzipper\\MadzipperServiceProvider"
+ ],
+ "aliases": {
+ "Madzipper": "Madnest\\Madzipper\\Madzipper"
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Madnest\\Madzipper\\": "src/Madnest/Madzipper"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jakub Theimer",
+ "email": "theimer@madne.st",
+ "homepage": "https://madne.st",
+ "role": "Developer"
+ }
+ ],
+ "description": "Wannabe successor of Chumper/Zipper package for Laravel",
+ "time": "2020-09-15T11:11:06+00:00"
+ },
{
"name": "markrogoyski/math-php",
"version": "v0.38.0",
@@ -3959,27 +4016,27 @@
},
{
"name": "nwidart/laravel-modules",
- "version": "7.2.0",
+ "version": "8.0.0",
"source": {
"type": "git",
"url": "https://github.com/nWidart/laravel-modules.git",
- "reference": "8980876d63096951e067bcaf8649d591d4c7f0da"
+ "reference": "7983e41c3832a13e521aa915532efdc7b67563af"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/8980876d63096951e067bcaf8649d591d4c7f0da",
- "reference": "8980876d63096951e067bcaf8649d591d4c7f0da",
+ "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/7983e41c3832a13e521aa915532efdc7b67563af",
+ "reference": "7983e41c3832a13e521aa915532efdc7b67563af",
"shasum": ""
},
"require": {
"ext-json": "*",
- "php": ">=7.2.5"
+ "php": ">=7.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
- "laravel/framework": "^7.0",
+ "laravel/framework": "^8.0",
"mockery/mockery": "~1.0",
- "orchestra/testbench": "^5.0",
+ "orchestra/testbench": "^6.0",
"phpstan/phpstan": "^0.12.14",
"phpunit/phpunit": "^8.5",
"spatie/phpunit-snapshot-assertions": "^2.1.0"
@@ -3995,7 +4052,7 @@
}
},
"branch-alias": {
- "dev-master": "7.0-dev"
+ "dev-master": "8.0-dev"
}
},
"autoload": {
@@ -4032,7 +4089,7 @@
"type": "github"
}
],
- "time": "2020-07-30T17:10:13+00:00"
+ "time": "2020-10-03T14:56:31+00:00"
},
{
"name": "oomphinc/composer-installers-extender",
diff --git a/config/app.php b/config/app.php
index b9f984ee..7fe7c3f3 100755
--- a/config/app.php
+++ b/config/app.php
@@ -7,6 +7,8 @@
* your install. Otherwise, any changes here will get overridden in an update!
*/
+use Carbon\Carbon;
+
return [
'name' => env('APP_NAME', 'phpvms'),
'env' => env('APP_ENV', 'dev'),
@@ -92,7 +94,7 @@ return [
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
- 'Carbon' => \Carbon\Carbon::class,
+ 'Carbon' => Carbon::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
diff --git a/modules/Importer/Config/config.php b/config/importer.php
similarity index 100%
rename from modules/Importer/Config/config.php
rename to config/importer.php
diff --git a/modules/Installer/Config/config.php b/config/installer.php
similarity index 100%
rename from modules/Installer/Config/config.php
rename to config/installer.php
diff --git a/config/modules.php b/config/modules.php
index b724fda2..7a3a73fb 100644
--- a/config/modules.php
+++ b/config/modules.php
@@ -1,5 +1,6 @@
'Http/Routes/web.php',
'routes-api' => 'Http/Routes/api.php',
'routes-admin' => 'Http/Routes/admin.php',
+ 'provider' => 'Providers/AppServiceProvider.php',
+ 'route-provider' => 'Providers/RouteServiceProvider.php',
'event-service-provider' => 'Providers/EventServiceProvider.php',
'views/index' => 'Resources/views/index.blade.php',
'views/index-admin' => 'Resources/views/admin/index.blade.php',
@@ -29,6 +32,7 @@ return [
'routes-api' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'],
'provider' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'],
+ 'route-provider' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'],
'event-service-provider' => [
'LOWER_NAME',
'STUDLY_NAME',
@@ -36,7 +40,7 @@ return [
'CLASS_NAMESPACE',
],
'listener-test' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'],
- 'views/index' => ['LOWER_NAME'],
+ 'views/index' => ['LOWER_NAME', 'STUDLY_NAME'],
'views/index-admin' => ['LOWER_NAME', 'STUDLY_NAME'],
'views/frontend' => ['STUDLY_NAME'],
'views/admin' => ['STUDLY_NAME'],
@@ -89,7 +93,7 @@ return [
'filter' => ['path' => 'Http/Middleware', 'generate' => true],
'request' => ['path' => 'Http/Requests', 'generate' => true],
'routes' => ['path' => 'Http/Routes', 'generate' => true],
- 'provider' => ['path' => 'Providers', 'generate' => true],
+ 'provider' => ['path' => 'Providers', 'generate' => false],
'assets' => ['path' => 'Resources/assets', 'generate' => true],
'lang' => ['path' => 'Resources/lang', 'generate' => true],
'views' => ['path' => 'Resources/views', 'generate' => true],
@@ -162,7 +166,7 @@ return [
'translations' => true,
],
- 'activator' => 'file',
+ 'activator' => 'database',
'activators' => [
'file' => [
'class' => FileActivator::class,
@@ -170,5 +174,8 @@ return [
'cache-key' => 'activator.installed',
'cache-lifetime' => 0,
],
+ 'database' => [
+ 'class' => DatabaseActivator::class,
+ ],
],
];
diff --git a/config/modules_statuses.json b/config/modules_statuses.json
deleted file mode 100644
index aae2d91e..00000000
--- a/config/modules_statuses.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "Awards": true,
- "Importer": true,
- "Installer": true,
- "Sample": true,
- "Updater": true,
- "VMSAcars": true,
- "Vacentral": true,
- "TestModule": true
-}
diff --git a/modules/Updater/Config/config.php b/config/updater.php
similarity index 100%
rename from modules/Updater/Config/config.php
rename to config/updater.php
diff --git a/modules/.gitignore b/modules/.gitignore
index 3089778c..01d5a85e 100644
--- a/modules/.gitignore
+++ b/modules/.gitignore
@@ -8,3 +8,4 @@
!/Installer
!/Updater
!/Vacentral
+!/ModulesManager
diff --git a/modules/Importer/Providers/ImporterServiceProvider.php b/modules/Importer/Providers/ImporterServiceProvider.php
deleted file mode 100644
index 6369c455..00000000
--- a/modules/Importer/Providers/ImporterServiceProvider.php
+++ /dev/null
@@ -1,96 +0,0 @@
-registerCommands();
- $this->registerRoutes();
- $this->registerTranslations();
- $this->registerConfig();
- $this->registerViews();
- }
-
- /**
- * Register console commands
- */
- protected function registerCommands()
- {
- $this->commands([
- ImportFromClassicCommand::class,
- ]);
- }
-
- /**
- * Register the routes
- */
- protected function registerRoutes()
- {
- Route::group([
- 'as' => 'importer.',
- 'prefix' => 'importer',
- 'middleware' => ['web'],
- 'namespace' => 'Modules\Importer\Http\Controllers',
- ], function () {
- Route::get('/', 'ImporterController@index')->name('index');
- Route::post('/config', 'ImporterController@config')->name('config');
- Route::post('/dbtest', 'ImporterController@dbtest')->name('dbtest');
-
- // Run the actual importer process. Additional middleware
- Route::post('/run', 'ImporterController@run')->middleware('api')->name('run');
- Route::post('/complete', 'ImporterController@complete')->name('complete');
- });
- }
-
- /**
- * Register config.
- */
- protected function registerConfig()
- {
- $this->mergeConfigFrom(__DIR__.'/../Config/config.php', 'importer');
- }
-
- /**
- * Register views.
- */
- public function registerViews()
- {
- $viewPath = resource_path('views/modules/importer');
- $sourcePath = __DIR__.'/../Resources/views';
-
- $this->publishes([$sourcePath => $viewPath], 'views');
-
- $paths = array_map(
- function ($path) {
- return $path.'/modules/importer';
- },
- \Config::get('view.paths')
- );
-
- $paths[] = $sourcePath;
- $this->loadViewsFrom($paths, 'importer');
- }
-
- /**
- * Register translations.
- */
- public function registerTranslations()
- {
- $langPath = resource_path('lang/modules/importer');
-
- if (is_dir($langPath)) {
- $this->loadTranslationsFrom($langPath, 'importer');
- } else {
- $this->loadTranslationsFrom(__DIR__.'/../Resources/lang', 'importer');
- }
- }
-}
diff --git a/modules/Importer/composer.json b/modules/Importer/composer.json
deleted file mode 100644
index 3265e9da..00000000
--- a/modules/Importer/composer.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "phpvms/importer",
- "type": "laravel-library",
- "description": "The importer module for phpVMS",
- "authors": [
- {
- "name": "Nabeel Shahzad",
- "email": ""
- }
- ],
- "require": {
- "composer/installers": "~1.0"
- },
- "extra": {
- "laravel": {
- "providers": [
- "Modules\\Importer\\Providers\\ImporterServiceProvider"
- ],
- "aliases": {
-
- }
- }
- },
- "autoload": {
- "psr-4": {
- "Modules\\Importer\\": ""
- }
- }
-}
diff --git a/modules/Importer/module.json b/modules/Importer/module.json
deleted file mode 100644
index 8c23d2b1..00000000
--- a/modules/Importer/module.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "Importer",
- "alias": "importer",
- "description": "",
- "keywords": [],
- "active": 1,
- "order": 0,
- "providers": [
- "Modules\\Importer\\Providers\\ImporterServiceProvider"
- ],
- "aliases": {},
- "files": [],
- "requires": []
-}
diff --git a/modules/Installer/Providers/InstallerServiceProvider.php b/modules/Installer/Providers/InstallerServiceProvider.php
deleted file mode 100644
index 5150d7cd..00000000
--- a/modules/Installer/Providers/InstallerServiceProvider.php
+++ /dev/null
@@ -1,101 +0,0 @@
-registerRoutes();
- $this->registerTranslations();
- $this->registerConfig();
- $this->registerViews();
- }
-
- /**
- * Register the routes
- */
- protected function registerRoutes()
- {
- Route::group([
- 'as' => 'installer.',
- 'prefix' => 'install',
- 'middleware' => ['web'],
- 'namespace' => 'Modules\Installer\Http\Controllers',
- ], function () {
- Route::get('/', 'InstallerController@index')->name('index');
- Route::post('/dbtest', 'InstallerController@dbtest')->name('dbtest');
-
- Route::get('/step1', 'InstallerController@step1')->name('step1');
- Route::post('/step1', 'InstallerController@step1')->name('step1post');
-
- Route::get('/step2', 'InstallerController@step2')->name('step2');
- Route::post('/envsetup', 'InstallerController@envsetup')->name('envsetup');
- Route::get('/dbsetup', 'InstallerController@dbsetup')->name('dbsetup');
-
- Route::get('/step3', 'InstallerController@step3')->name('step3');
- Route::post('/usersetup', 'InstallerController@usersetup')->name('usersetup');
-
- Route::get('/complete', 'InstallerController@complete')->name('complete');
- });
- }
-
- /**
- * Register config.
- */
- protected function registerConfig()
- {
- $this->mergeConfigFrom(__DIR__.'/../Config/config.php', 'installer');
- }
-
- /**
- * Register views.
- */
- public function registerViews()
- {
- $viewPath = resource_path('views/modules/installer');
- $sourcePath = __DIR__.'/../Resources/views';
-
- $this->publishes([
- $sourcePath => $viewPath,
- ], 'views');
-
- $paths = array_map(
- function ($path) {
- return $path.'/modules/installer';
- },
- \Config::get('view.paths')
- );
-
- $paths[] = $sourcePath;
- $this->loadViewsFrom($paths, 'installer');
- }
-
- /**
- * Register translations.
- */
- public function registerTranslations()
- {
- $langPath = resource_path('lang/modules/installer');
-
- if (is_dir($langPath)) {
- $this->loadTranslationsFrom($langPath, 'installer');
- } else {
- $this->loadTranslationsFrom(__DIR__.'/../Resources/lang', 'installer');
- }
- }
-
- /**
- * Get the services provided by the provider.
- */
- public function provides(): array
- {
- return [];
- }
-}
diff --git a/modules/Installer/composer.json b/modules/Installer/composer.json
deleted file mode 100644
index 3de0cf79..00000000
--- a/modules/Installer/composer.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "phpvms/installer",
- "license": "",
- "type": "laravel-library",
- "description": "The installer module for phpVMS",
- "authors": [
- {
- "name": "Nabeel Shahzad",
- "email": "nabeel@phpvms.net"
- }
- ],
- "require": {
- "composer/installers": "~1.0"
- },
- "extra": {
- "laravel": {
- "providers": [
- "Modules\\Installer\\Providers\\InstallerServiceProvider"
- ],
- "aliases": {
-
- }
- }
- },
- "autoload": {
- "psr-4": {
- "Modules\\Installer\\": ""
- }
- }
-}
diff --git a/modules/Installer/module.json b/modules/Installer/module.json
deleted file mode 100644
index f43d81a7..00000000
--- a/modules/Installer/module.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "Installer",
- "alias": "installer",
- "description": "",
- "keywords": [],
- "active": 1,
- "order": 0,
- "providers": [
- "Modules\\Installer\\Providers\\InstallerServiceProvider"
- ],
- "aliases": {},
- "files": [],
- "requires": []
-}
diff --git a/modules/Updater/Providers/UpdateServiceProvider.php b/modules/Updater/Providers/UpdateServiceProvider.php
deleted file mode 100644
index 38516de4..00000000
--- a/modules/Updater/Providers/UpdateServiceProvider.php
+++ /dev/null
@@ -1,95 +0,0 @@
-registerRoutes();
- $this->registerTranslations();
- $this->registerConfig();
- $this->registerViews();
- }
-
- /**
- * Register the routes
- */
- protected function registerRoutes()
- {
- Route::group([
- 'as' => 'update.',
- 'prefix' => 'update',
- 'middleware' => ['web', 'auth', 'ability:admin,admin-access'],
- 'namespace' => 'Modules\Updater\Http\Controllers',
- ], function () {
- Route::get('/', 'UpdateController@index')->name('index');
-
- Route::get('/step1', 'UpdateController@step1')->name('step1');
- Route::post('/step1', 'UpdateController@step1')->name('step1post');
-
- Route::post('/run-migrations', 'UpdateController@run_migrations')->name('run_migrations');
- Route::get('/complete', 'UpdateController@complete')->name('complete');
-
- // Routes for the update downloader
- Route::get('/downloader', 'UpdateController@updater')->name('updater');
- Route::post('/downloader', 'UpdateController@update_download')->name('update_download');
- });
- }
-
- /**
- * Register config.
- */
- protected function registerConfig()
- {
- $this->mergeConfigFrom(__DIR__.'/../Config/config.php', 'updater');
- }
-
- /**
- * Register views.
- */
- public function registerViews()
- {
- $viewPath = resource_path('views/modules/updater');
- $sourcePath = __DIR__.'/../Resources/views';
-
- $this->publishes([
- $sourcePath => $viewPath,
- ], 'views');
-
- $paths = array_map(
- function ($path) {
- return $path.'/modules/updater';
- },
- \Config::get('view.paths')
- );
-
- $paths[] = $sourcePath;
- $this->loadViewsFrom($paths, 'updater');
- }
-
- /**
- * Register translations.
- */
- public function registerTranslations()
- {
- $langPath = resource_path('lang/modules/updater');
-
- if (is_dir($langPath)) {
- $this->loadTranslationsFrom($langPath, 'updater');
- } else {
- $this->loadTranslationsFrom(__DIR__.'/../Resources/lang', 'updater');
- }
- }
-
- /**
- * Get the services provided by the provider.
- */
- public function provides(): array
- {
- return [];
- }
-}
diff --git a/modules/Updater/composer.json b/modules/Updater/composer.json
deleted file mode 100644
index b88da50e..00000000
--- a/modules/Updater/composer.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "phpvms/updater",
- "license": "",
- "type": "laravel-library",
- "description": "The installer module for phpVMS",
- "authors": [
- {
- "name": "Nabeel Shahzad",
- "email": "nabeel@phpvms.net"
- }
- ],
- "require": {
- "composer/installers": "~1.0"
- },
- "extra": {
- "laravel": {
- "providers": [
- "Modules\\Updater\\Providers\\UpdateServiceProvider"
- ],
- "aliases": {
-
- }
- }
- },
- "autoload": {
- "psr-4": {
- "Modules\\Installer\\": ""
- }
- }
-}
diff --git a/modules/Updater/module.json b/modules/Updater/module.json
deleted file mode 100644
index 0860a8ef..00000000
--- a/modules/Updater/module.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "Updater",
- "alias": "updater",
- "description": "",
- "keywords": [],
- "active": 1,
- "order": 0,
- "providers": [
- "Modules\\Updater\\Providers\\UpdateServiceProvider"
- ],
- "aliases": {},
- "files": [],
- "requires": []
-}
diff --git a/resources/stubs/modules/json.stub b/resources/stubs/modules/json.stub
index 41bb2337..d3f6985b 100644
--- a/resources/stubs/modules/json.stub
+++ b/resources/stubs/modules/json.stub
@@ -6,7 +6,7 @@
"active": 1,
"order": 0,
"providers": [
- "$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\$STUDLY_NAME$ServiceProvider",
+ "$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\AppServiceProvider",
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\EventServiceProvider",
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\RouteServiceProvider"
],
diff --git a/resources/stubs/modules/route-provider.stub b/resources/stubs/modules/route-provider.stub
index df3649c9..3263dc96 100644
--- a/resources/stubs/modules/route-provider.stub
+++ b/resources/stubs/modules/route-provider.stub
@@ -1,6 +1,6 @@
Hello World
diff --git a/resources/views/admin/flash/message.blade.php b/resources/views/admin/flash/message.blade.php
index b165337e..1f6bf746 100644
--- a/resources/views/admin/flash/message.blade.php
+++ b/resources/views/admin/flash/message.blade.php
@@ -1,4 +1,4 @@
-@foreach (session('flash_notification', collect())->toArray() as $message)
+@foreach (session('flash_notification', collect()) as $message)
@if ($message['overlay'])
@include('flash::modal', [
'modalClass' => 'flash-modal',
diff --git a/resources/views/admin/menu.blade.php b/resources/views/admin/menu.blade.php
index 4c0690f8..ea3fd53a 100644
--- a/resources/views/admin/menu.blade.php
+++ b/resources/views/admin/menu.blade.php
@@ -74,6 +74,10 @@
pages/links
@endability
+ @ability('admin', 'modules')
+ Modules Manager
+ @endability
+
@ability('admin', 'maintenance')
maintenance
@endability
diff --git a/resources/views/admin/modules/create.blade.php b/resources/views/admin/modules/create.blade.php
new file mode 100644
index 00000000..14eaccc9
--- /dev/null
+++ b/resources/views/admin/modules/create.blade.php
@@ -0,0 +1,37 @@
+@extends('admin.app')
+@section('title', "Add Module")
+@section('content')
+
+
+
Please note that :
+
+ - Module Folder must be on top level of the zip.
+ - Name of the zip must be exactly equal to the name of the module folder inside.
+
+
Module Zip Structure :
+
+ -
+ ModuleName.zip
+
+
+ - ModuleName Folder
+
+ - Config
+ - Console
+ - ...
+
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/admin/modules/edit.blade.php b/resources/views/admin/modules/edit.blade.php
new file mode 100644
index 00000000..b27a6a2d
--- /dev/null
+++ b/resources/views/admin/modules/edit.blade.php
@@ -0,0 +1,35 @@
+@extends('admin.app')
+@section('title', "Edit " . $module->name)
+@section('content')
+
+
+
Change Module Status :
+ {{Form::open(['route' => ['admin.modules.update', $module->id]])}}
+
+
+ {{Form::label('Enabled ?')}}
+ {{Form::checkbox('enabled', '', $module->enabled)}}
+
+
+ {{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
+ {{Form::close()}}
+
+
+
+
Delete Module
+
+
+ {{Form::open(['route' => ['admin.modules.destroy', $module->id], 'method' => 'delete'])}}
+
+
+ Type in {{strtoupper($module->name)}} to Delete :
+ {{Form::text('verify', '', ['class' => 'form-control', 'required' => 'required'])}}
+
+
+ {{ Form::button('Delete', ['type' => 'submit', 'class' => 'btn btn-danger']) }}
+ {{Form::close()}}
+
+
+
+
+@endsection
diff --git a/resources/views/admin/modules/index.blade.php b/resources/views/admin/modules/index.blade.php
new file mode 100644
index 00000000..7c31d090
--- /dev/null
+++ b/resources/views/admin/modules/index.blade.php
@@ -0,0 +1,79 @@
+@extends('admin.app')
+@section('title', "Modules Manager")
+@section('actions')
+
+
+
+ Add New
+
+@endsection
+@section('content')
+
+
+
+
+
Installed Modules
+
+
+
+ | Module |
+ Status |
+ Actions |
+
+
+ @forelse($modules as $module)
+
+ | {{$module->name}} |
+
+ @if($module->enabled == 1)
+ Enabled
+ @else
+ Disabled
+ @endif
+ |
+
+ Edit Module
+ View Admin Module
+ View Frontend Module
+ |
+
+ @empty
+
+ |
+ No Modules Installed Yet!
+ |
+
+ @endforelse
+
+
+
+ @if($new_modules)
+
Not Installed Modules
+
+
+
+ | Module |
+ Status |
+ Actions |
+
+
+ @foreach($new_modules as $module)
+
+ | {{ $module }} |
+ Disabled |
+
+ {{Form::open(['route' => ['admin.modules.enable']])}}
+ {{ Form::hidden('name', $module) }}
+ {{ Form::button('Activate Module', ['type' => 'submit', 'class' => 'btn btn-success']) }}
+ {{Form::close()}}
+ |
+
+ @endforeach
+
+
+ @endif
+
+
+
+
+@endsection
diff --git a/modules/Importer/Resources/views/app.blade.php b/resources/views/system/importer/app.blade.php
similarity index 98%
rename from modules/Importer/Resources/views/app.blade.php
rename to resources/views/system/importer/app.blade.php
index cd52b133..481ad447 100644
--- a/modules/Importer/Resources/views/app.blade.php
+++ b/resources/views/system/importer/app.blade.php
@@ -53,7 +53,7 @@
- @include('importer::flash.message')
+ @include('system.importer.flash.message')
@yield('content')
diff --git a/modules/Importer/Resources/views/complete.blade.php b/resources/views/system/importer/complete.blade.php
similarity index 94%
rename from modules/Importer/Resources/views/complete.blade.php
rename to resources/views/system/importer/complete.blade.php
index ee52e38c..e57aea49 100644
--- a/modules/Importer/Resources/views/complete.blade.php
+++ b/resources/views/system/importer/complete.blade.php
@@ -1,4 +1,4 @@
-@extends('importer::app')
+@extends('system.importer.app')
@section('title', 'Import Completed!')
@section('content')
diff --git a/modules/Importer/Resources/views/dbtest.blade.php b/resources/views/system/importer/dbtest.blade.php
similarity index 100%
rename from modules/Importer/Resources/views/dbtest.blade.php
rename to resources/views/system/importer/dbtest.blade.php
diff --git a/modules/Importer/Resources/views/error.blade.php b/resources/views/system/importer/error.blade.php
similarity index 84%
rename from modules/Importer/Resources/views/error.blade.php
rename to resources/views/system/importer/error.blade.php
index 938f29c9..2acad826 100644
--- a/modules/Importer/Resources/views/error.blade.php
+++ b/resources/views/system/importer/error.blade.php
@@ -1,4 +1,4 @@
-@extends('importer::app')
+@extends('system.importer.app')
@section('title', 'Import Error!')
@section('content')
diff --git a/modules/Importer/Resources/views/flash/check_error.blade.php b/resources/views/system/importer/flash/check_error.blade.php
similarity index 100%
rename from modules/Importer/Resources/views/flash/check_error.blade.php
rename to resources/views/system/importer/flash/check_error.blade.php
diff --git a/modules/Importer/Resources/views/flash/message.blade.php b/resources/views/system/importer/flash/message.blade.php
similarity index 100%
rename from modules/Importer/Resources/views/flash/message.blade.php
rename to resources/views/system/importer/flash/message.blade.php
diff --git a/modules/Importer/Resources/views/step1-configure.blade.php b/resources/views/system/importer/step1-configure.blade.php
similarity index 99%
rename from modules/Importer/Resources/views/step1-configure.blade.php
rename to resources/views/system/importer/step1-configure.blade.php
index 82e5dde0..5260b79b 100644
--- a/modules/Importer/Resources/views/step1-configure.blade.php
+++ b/resources/views/system/importer/step1-configure.blade.php
@@ -1,4 +1,4 @@
-@extends('importer::app')
+@extends('system.importer.app')
@section('title', 'Import Configuration')
@section('content')
diff --git a/modules/Importer/Resources/views/step2-processing.blade.php b/resources/views/system/importer/step2-processing.blade.php
similarity index 99%
rename from modules/Importer/Resources/views/step2-processing.blade.php
rename to resources/views/system/importer/step2-processing.blade.php
index ce6c27ce..dc86f79e 100644
--- a/modules/Importer/Resources/views/step2-processing.blade.php
+++ b/resources/views/system/importer/step2-processing.blade.php
@@ -1,4 +1,4 @@
-@extends('importer::app')
+@extends('system.importer.app')
@section('title', 'Import Configuration')
@section('content')
diff --git a/modules/Installer/Resources/views/app.blade.php b/resources/views/system/installer/app.blade.php
similarity index 98%
rename from modules/Installer/Resources/views/app.blade.php
rename to resources/views/system/installer/app.blade.php
index eb0fcf52..8f57ba5d 100644
--- a/modules/Installer/Resources/views/app.blade.php
+++ b/resources/views/system/installer/app.blade.php
@@ -53,7 +53,7 @@
- @include('installer::flash.message')
+ @include('system.installer.flash.message')
@yield('content')
diff --git a/modules/Installer/Resources/views/errors/already-installed.blade.php b/resources/views/system/installer/errors/already-installed.blade.php
similarity index 91%
rename from modules/Installer/Resources/views/errors/already-installed.blade.php
rename to resources/views/system/installer/errors/already-installed.blade.php
index 5d15fd1f..6bfb57f8 100644
--- a/modules/Installer/Resources/views/errors/already-installed.blade.php
+++ b/resources/views/system/installer/errors/already-installed.blade.php
@@ -1,4 +1,4 @@
-@extends('installer::app')
+@extends('system.installer.app')
@section('content')
phpVMS already installed!
diff --git a/modules/Installer/Resources/views/flash/check_error.blade.php b/resources/views/system/installer/flash/check_error.blade.php
similarity index 100%
rename from modules/Installer/Resources/views/flash/check_error.blade.php
rename to resources/views/system/installer/flash/check_error.blade.php
diff --git a/modules/Installer/Resources/views/flash/message.blade.php b/resources/views/system/installer/flash/message.blade.php
similarity index 100%
rename from modules/Installer/Resources/views/flash/message.blade.php
rename to resources/views/system/installer/flash/message.blade.php
diff --git a/modules/Installer/Resources/views/install/dbtest.blade.php b/resources/views/system/installer/install/dbtest.blade.php
similarity index 100%
rename from modules/Installer/Resources/views/install/dbtest.blade.php
rename to resources/views/system/installer/install/dbtest.blade.php
diff --git a/modules/Installer/Resources/views/install/index-start.blade.php b/resources/views/system/installer/install/index-start.blade.php
similarity index 73%
rename from modules/Installer/Resources/views/install/index-start.blade.php
rename to resources/views/system/installer/install/index-start.blade.php
index 504376a5..94475517 100644
--- a/modules/Installer/Resources/views/install/index-start.blade.php
+++ b/resources/views/system/installer/install/index-start.blade.php
@@ -1,8 +1,8 @@
-@extends('installer::app')
+@extends('system.installer.app')
@section('title', 'Install phpVMS')
@section('content')
- Press continue to start
+ Click on Start to Continue
{{ Form::open(['route' => 'installer.step1post', 'method' => 'post']) }}
{{ Form::submit('Start >>', ['class' => 'btn btn-success']) }}
diff --git a/modules/Installer/Resources/views/install/steps/step1-requirements.blade.php b/resources/views/system/installer/install/steps/step1-requirements.blade.php
similarity index 98%
rename from modules/Installer/Resources/views/install/steps/step1-requirements.blade.php
rename to resources/views/system/installer/install/steps/step1-requirements.blade.php
index 57957bc0..e7473888 100644
--- a/modules/Installer/Resources/views/install/steps/step1-requirements.blade.php
+++ b/resources/views/system/installer/install/steps/step1-requirements.blade.php
@@ -1,4 +1,4 @@
-@extends('installer::app')
+@extends('system.installer.app')
@section('title', 'Requirements Check')
@section('content')
diff --git a/modules/Installer/Resources/views/install/steps/step2-db.blade.php b/resources/views/system/installer/install/steps/step2-db.blade.php
similarity index 99%
rename from modules/Installer/Resources/views/install/steps/step2-db.blade.php
rename to resources/views/system/installer/install/steps/step2-db.blade.php
index a0e2c97c..784d3066 100644
--- a/modules/Installer/Resources/views/install/steps/step2-db.blade.php
+++ b/resources/views/system/installer/install/steps/step2-db.blade.php
@@ -1,4 +1,4 @@
-@extends('installer::app')
+@extends('system.installer.app')
@section('title', 'Database Setup')
@section('content')
diff --git a/modules/Installer/Resources/views/install/steps/step2a-db_output.blade.php b/resources/views/system/installer/install/steps/step2a-db_output.blade.php
similarity index 93%
rename from modules/Installer/Resources/views/install/steps/step2a-db_output.blade.php
rename to resources/views/system/installer/install/steps/step2a-db_output.blade.php
index f69f1b21..9aa9db80 100644
--- a/modules/Installer/Resources/views/install/steps/step2a-db_output.blade.php
+++ b/resources/views/system/installer/install/steps/step2a-db_output.blade.php
@@ -1,4 +1,4 @@
-@extends('installer::app')
+@extends('system.installer.app')
@section('title', 'Database Setup Completed')
@section('content')
diff --git a/modules/Installer/Resources/views/install/steps/step3-user.blade.php b/resources/views/system/installer/install/steps/step3-user.blade.php
similarity index 83%
rename from modules/Installer/Resources/views/install/steps/step3-user.blade.php
rename to resources/views/system/installer/install/steps/step3-user.blade.php
index fe26b71b..e9a4e8f9 100644
--- a/modules/Installer/Resources/views/install/steps/step3-user.blade.php
+++ b/resources/views/system/installer/install/steps/step3-user.blade.php
@@ -1,4 +1,4 @@
-@extends('installer::app')
+@extends('system.installer.app')
@section('title', 'User Setup')
@section('content')
@@ -23,7 +23,7 @@
{{ Form::input('text', 'airline_icao', null, ['class' => 'form-control']) }}
- @include('installer::flash/check_error', ['field' => 'airline_icao'])
+ @include('system.installer.flash/check_error', ['field' => 'airline_icao'])
|
@@ -33,7 +33,7 @@
{{ Form::input('text', 'airline_name', null, ['class' => 'form-control']) }}
- @include('installer::flash/check_error', ['field' => 'airline_name'])
+ @include('system.installer.flash/check_error', ['field' => 'airline_name'])
|
@@ -43,7 +43,7 @@
{{ Form::select('airline_country', $countries, null, ['class' => 'form-control select2' ]) }}
- @include('installer::flash/check_error', ['field' => 'airline_country'])
+ @include('system.installer.flash/check_error', ['field' => 'airline_country'])
|
@@ -57,7 +57,7 @@
{{ Form::input('text', 'name', null, ['class' => 'form-control']) }}
- @include('installer::flash/check_error', ['field' => 'name'])
+ @include('system.installer.flash/check_error', ['field' => 'name'])
|
@@ -67,7 +67,7 @@
{{ Form::input('text', 'email', null, ['class' => 'form-control']) }}
- @include('installer::flash/check_error', ['field' => 'email'])
+ @include('system.installer.flash/check_error', ['field' => 'email'])
|
@@ -76,7 +76,7 @@
Password |
{{ Form::password('password', ['class' => 'form-control']) }}
- @include('installer::flash/check_error', ['field' => 'password'])
+ @include('system.installer.flash/check_error', ['field' => 'password'])
|
@@ -84,7 +84,7 @@
Password Confirm |
{{ Form::password('password_confirmation', ['class' => 'form-control']) }}
- @include('installer::flash/check_error', ['field' => 'password_confirmation'])
+ @include('system.installer.flash/check_error', ['field' => 'password_confirmation'])
|
diff --git a/modules/Installer/Resources/views/install/steps/step3a-completed.blade.php b/resources/views/system/installer/install/steps/step3a-completed.blade.php
similarity index 94%
rename from modules/Installer/Resources/views/install/steps/step3a-completed.blade.php
rename to resources/views/system/installer/install/steps/step3a-completed.blade.php
index 80fa9463..e7d711f4 100644
--- a/modules/Installer/Resources/views/install/steps/step3a-completed.blade.php
+++ b/resources/views/system/installer/install/steps/step3a-completed.blade.php
@@ -1,4 +1,4 @@
-@extends('installer::app')
+@extends('system.installer.app')
@section('title', 'Installation Completed!')
@section('content')
diff --git a/modules/Updater/Resources/views/app.blade.php b/resources/views/system/updater/app.blade.php
similarity index 98%
rename from modules/Updater/Resources/views/app.blade.php
rename to resources/views/system/updater/app.blade.php
index d9c9c647..fef64593 100644
--- a/modules/Updater/Resources/views/app.blade.php
+++ b/resources/views/system/updater/app.blade.php
@@ -53,7 +53,7 @@
- @include('updater::flash.message')
+ @include('system.updater.flash.message')
@yield('content')
diff --git a/modules/Updater/Resources/views/downloader/downloader.blade.php b/resources/views/system/updater/downloader/downloader.blade.php
similarity index 92%
rename from modules/Updater/Resources/views/downloader/downloader.blade.php
rename to resources/views/system/updater/downloader/downloader.blade.php
index 276c533a..1bf997f3 100644
--- a/modules/Updater/Resources/views/downloader/downloader.blade.php
+++ b/resources/views/system/updater/downloader/downloader.blade.php
@@ -1,4 +1,4 @@
-@extends('updater::app')
+@extends('system.updater.app')
@section('title', 'Update phpVMS')
@section('content')
diff --git a/modules/Updater/Resources/views/flash/check_error.blade.php b/resources/views/system/updater/flash/check_error.blade.php
similarity index 100%
rename from modules/Updater/Resources/views/flash/check_error.blade.php
rename to resources/views/system/updater/flash/check_error.blade.php
diff --git a/modules/Updater/Resources/views/flash/message.blade.php b/resources/views/system/updater/flash/message.blade.php
similarity index 100%
rename from modules/Updater/Resources/views/flash/message.blade.php
rename to resources/views/system/updater/flash/message.blade.php
diff --git a/modules/Updater/Resources/views/index-start.blade.php b/resources/views/system/updater/index-start.blade.php
similarity index 92%
rename from modules/Updater/Resources/views/index-start.blade.php
rename to resources/views/system/updater/index-start.blade.php
index f550feeb..bee3d08e 100644
--- a/modules/Updater/Resources/views/index-start.blade.php
+++ b/resources/views/system/updater/index-start.blade.php
@@ -1,4 +1,4 @@
-@extends('updater::app')
+@extends('system.updater.app')
@section('title', 'Update phpVMS')
@section('content')
diff --git a/modules/Updater/Resources/views/steps/step1-no-update.blade.php b/resources/views/system/updater/steps/step1-no-update.blade.php
similarity index 91%
rename from modules/Updater/Resources/views/steps/step1-no-update.blade.php
rename to resources/views/system/updater/steps/step1-no-update.blade.php
index bbe70c32..d39f91c0 100644
--- a/modules/Updater/Resources/views/steps/step1-no-update.blade.php
+++ b/resources/views/system/updater/steps/step1-no-update.blade.php
@@ -1,4 +1,4 @@
-@extends('updater::app')
+@extends('system.updater.app')
@section('title', 'Update phpVMS')
@section('content')
diff --git a/modules/Updater/Resources/views/steps/step1-update-available.blade.php b/resources/views/system/updater/steps/step1-update-available.blade.php
similarity index 91%
rename from modules/Updater/Resources/views/steps/step1-update-available.blade.php
rename to resources/views/system/updater/steps/step1-update-available.blade.php
index 29f3e1d6..c1ad986a 100644
--- a/modules/Updater/Resources/views/steps/step1-update-available.blade.php
+++ b/resources/views/system/updater/steps/step1-update-available.blade.php
@@ -1,4 +1,4 @@
-@extends('updater::app')
+@extends('system.updater.app')
@section('title', 'Update phpVMS')
@section('content')
diff --git a/modules/Updater/Resources/views/steps/step2-migrations-done.blade.php b/resources/views/system/updater/steps/step2-migrations-done.blade.php
similarity index 93%
rename from modules/Updater/Resources/views/steps/step2-migrations-done.blade.php
rename to resources/views/system/updater/steps/step2-migrations-done.blade.php
index 045a16b6..8aefd8f0 100644
--- a/modules/Updater/Resources/views/steps/step2-migrations-done.blade.php
+++ b/resources/views/system/updater/steps/step2-migrations-done.blade.php
@@ -1,4 +1,4 @@
-@extends('updater::app')
+@extends('system.updater.app')
@section('title', 'Update Completed')
@section('content')
diff --git a/modules/Updater/Resources/views/steps/step3-update-complete.blade.php b/resources/views/system/updater/steps/step3-update-complete.blade.php
similarity index 91%
rename from modules/Updater/Resources/views/steps/step3-update-complete.blade.php
rename to resources/views/system/updater/steps/step3-update-complete.blade.php
index 247c2cd4..d7329f55 100644
--- a/modules/Updater/Resources/views/steps/step3-update-complete.blade.php
+++ b/resources/views/system/updater/steps/step3-update-complete.blade.php
@@ -1,4 +1,4 @@
-@extends('updater::app')
+@extends('system.updater.app')
@section('title', 'Update Completed')
@section('content')